Void Teleport to spawn
#3
(09-12-2016, 03:40 AM)NiLSPACE Wrote: 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);

Thanks! I did have the hook in, just forgot to mention that. I tested your change and it does seem to teleport the player but it seems glitched on my client. I also tried in native MC 1.10.2 and still seeing the glitch. It looks almost like a video refresh issue. It flickers like crazy.
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)