Need help with the /tp command

Hi, This is the command i have in my es_extended/server/commands… Mine is set to superadmin only but you can change that.

TriggerEvent('es:addGroupCommand', 'tp', 'superadmin', function(source, args, user)
local x = tonumber(args[1])
local y = tonumber(args[2])
local z = tonumber(args[3])

if x and y and z then
	TriggerClientEvent('esx:teleport', source, {
		x = x,
		y = y,
		z = z
	})
else
	TriggerClientEvent('chatMessage', source, "SYSTEM", {255, 0, 0}, "Invalid coordinates!")
end
end, function(source, args, user)
TriggerClientEvent('chat:addMessage', source, { args = { '^1SYSTEM', 'Insufficient Permissions.' } })
end, {help = "Teleport to coordinates", params = {{name = "x", help = "X coords"}, {name = "y", help = "Y coords"}, {name = "z", help = "Z coords"}}})
2 Likes

Omg ! Thank you so so much, this works perfect !
For some reasons i still get a system message that says its not a valid command lol … but it still work so thats all that matters :heart_eyes:

thank you thank you thank you

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.