Created
August 19, 2016 17:11
-
-
Save Rene-Sackers/58435fe7af77f0c87c3e669dc855f6a2 to your computer and use it in GitHub Desktop.
Teleporting function for FiveReborn in LUA.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RegisterNetEvent("Teleport") | |
AddEventHandler("Teleport", function(x, y, z) | |
x, y, z = tonumber(x), tonumber(y), tonumber(z) | |
local player = GetPlayerPed() | |
-- Fucking floats. | |
x = 0.0 + x | |
y = 0.0 + y | |
z = 0.0 + z | |
DisplayNotification("Teleporting to " .. x .. ", " .. y .. ", " .. z) | |
SetEntityCoordsNoOffset(player, x, y, z, false, false, false, true) | |
local newPos = GetEntityCoords(player, false) | |
DisplayNotification("New location: " .. newPos.x .. ", " .. newPos.y .. ", " .. newPos.z) | |
end) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Where to put this file in fiveReborn?