Files
cuberite-2a/MCServer/Plugins/Core/top.lua
T

14 lines
383 B
Lua
Raw Normal View History

2013-07-27 16:24:03 +01:00
function HandleTopCommand( Split, Player )
2013-08-11 16:00:53 +01:00
2013-07-27 16:24:03 +01:00
local World = Player:GetWorld()
2013-08-11 16:00:53 +01:00
2013-07-27 16:24:03 +01:00
local PlayerPos = Player:GetPosition()
2013-08-11 16:00:53 +01:00
local Height = World:GetHeight( math.floor( PlayerPos.x ), math.floor( PlayerPos.z ) )
2013-07-27 16:24:03 +01:00
SetBackCoordinates( Player )
Player:TeleportToCoords( PlayerPos.x, Height+1, PlayerPos.z )
2013-08-11 16:00:53 +01:00
SendMessageSuccess( Player, "Teleported to the topmost block" )
2013-07-27 16:24:03 +01:00
return true
2013-08-11 16:00:53 +01:00
end