Void Teleport to spawn
#2
A simple
function OnPlayerMoving(Player)
    if (Player:GetPosY() < 0) then
        local World = Player:GetWorld()
        Player:TeleportToCoords(World:GetSpawnX(), World:GetSpawnY(), World:GetSpawnZ())
    end
end
Also, don't forget to add the hook on initialization of the plugin:
cPluginManager:AddHook(cPluginManager.HOOK_PLAYER_MOVING, OnPlayerMoving);
Reply
Thanks given by:


Messages In This Thread
Void Teleport to spawn - by feardevilz - 09-12-2016, 03:37 AM
RE: Void Teleport to spawn - by NiLSPACE - 09-12-2016, 03:40 AM
RE: Void Teleport to spawn - by feardevilz - 09-12-2016, 03:50 AM



Users browsing this thread: 1 Guest(s)