-
One reason could be the usage of the function.
If you tried with x, y, z then now try without the commas (x y z) instead. -
If that doesn’t work then try to provide the code for the teleport.
If you can’t find it then below is a simple teleport-to-coordinates command. Put it in a client script and restart it. Usage /teleportme x y z
RegisterCommand("teleportme", function(source, args, rawCommand)
local x = tonumber(args[1])
local y = tonumber(args[2])
local z = tonumber(args[3])
if x ~= nil or y ~= nil or z ~= nil then
if not GetGroundZFor_3dCoord(x, y, z, true) then
c = true
while c do
Citizen.Wait(0)
if not GetGroundZFor_3dCoord(x, y, z, true) then
z = (z + 0.5)
SetPedCoordsKeepVehicle(PlayerPedId(), x, y, z)
else
c = false
end
end
else
SetPedCoordsKeepVehicle(PlayerPedId(), x, y, z)
end
else
print("Incorrect input, usage: /teleportme x y z")
end
end, true)
What was used to create the above command
How To Create A Command
SetPedCoordsKeepVehicle()
GetGroundZFor_3dCoord()