I need help with an error, willing to pay

im getting an error in my drugs creator script, the creator has tried to help me we have tried many things but says he has never seen this error, ill paypal someone 20$ CAD if we can get it fixed.

I may be able to help add me on discord C0P0

still need help i can fix


The failing native is InvokeFunctionReference, if the resource itself is not calling this native directly, then some stack is calling this in the backend for a function that is failing. I do not know exactly what “bad cast” indicates but another user with the same style error was experiencing issues relating to variable types here: Execution failed for KVP (Bad Cast)

Ope okay three more minutes of looking and your exact issue came up [Unexpected Behavior] InvokeFunctionReference returns "Bad Cast" during NUI callback

It seems like bubble ending up pushing some fix for the bad cast error, and it may be that you need the CFX team to look at it themselves.

ya thats way over my head, the script in question i only have so many things i can even configure, and its really a drag and drop ready script, worked fine before, only have an issue when it tries to access my inventory items,

Are you certain that every item that is required is available in your inventory system? If types are an issue it could be related to trying to find a table for the item or even calling the string for the item name and it actually being nil instead of a value. Again though, there may be nothing you can do on your end except provide repro steps for the CFX team so they can try to figure out the actual problem.

You’ll need to provide your source, or a minimal reproducible example.

I’m fairly certain I remember most of my research from my thread that was cited, so I might be able to help, but I’m not doing it through DMs, and I’m not worried about 20 bucks - any fix for any code issue should be freely available public knowledge.

i sent u a dm

provide my source? i can make a quick video showing what im doing? like in game? sorry man im no dev coding is 100% not up my alley, i can do the simple stuff thats about it

if you can help via discord? i can screenshare probably the easiest

bad cast? That must be a typecast…
a typecast is when you have a variable as one type (e.g. a string) and you tell the compiler (in this case, it’s fiveM), to pretend that it’s a different variable type (e.g. an integer or a float / number). You should use this opportunity to learn more about WHY it’s failing…it’ll make you a better scripter and generate more specific questions that more people will be able to help with!

Hope this helps!

2 Likes

its soemthing related to my items


image
only crashes when it tries to pull something from the items list