[Lua] can't pass pos from GetEntityCoords as function parameter?


I’m making a function that effectively adds a custom blip on the map, however I ran into an issue with the GetEntityCoords function - the result of the function IS correct, but for some reason, when I try to pass it into my addBlip function, I get a weird error. The function works without a problem when I manually specify the coords at which to place the blip…

command event: https://pastebin.com/WJsdmW9M (the pos.x printed out is correct)
addblip function: https://pastebin.com/Rr1mSbG9

when I add coords to the command manually (so the script doesn’t call GetEntityCoords), the blip gets added without a problem, it’s the Vector3 returned by GetEntityCoords that creates and issue


x, y, z = table.unpack(GetEntityCoords(GetPlayerPed(-1), true))
Then you just pass the value x.y.z


the whole point of this is not having 10 arguments in the function, instead I just pass the table containing the XYZ coords, but the GetEntityCoords returns a Vector3, which, for some reason, can’t be passed as an argument


Yeah, this is a known todo entry to be able to send this across runtimes.