Table.unpack error

96ae9887cf7a17ab190c4c17d416c443

local x, y, z = table.unpack(GetEntityCoords(PlayerPedId(), false))
local vehicle = CreateVehicle(car, x + 2, y + 2, z + 1, GetEntityHeading(PlayerPedId()), true, false)

What’s causing this to error out?

Did you redefine table somewhere in your code?

Resolved with:

local Pos = GetEntityCoords(GetPlayerPed(-1), true)
local vehicle = CreateVehicle(car, Pos["x"], Pos["y"], Pos["z"], GetEntityHeading(PlayerPedId()), true, false)

Yes you don’t have to unpack vectors, you can just do Pos.x, Pos.y

However if your table library functions no longer work it sounds like you defined a variable with the name table somewhere

Correct, I had it defined in another location.