08-30-2015, 02:01 AM
PHP Code:
function Initialize(Plugin)
Plugin:SetName("RandomTP")
Plugin:SetVersion(1)
cPluginManager.BindCommand("/rtp", "randomTP.rtp", Randomtp, " ~ Random Teleport");
LOG("Initialised " .. Plugin:GetName() .. " v." .. Plugin:GetVersion())
return true
end
function Randomtp(Split, Player)
if (#Split ~= 1) then
Player:SendMessage("Usage: /rtp")
return true
else
X = math.random(-2000, 2000)
Z = math.random(-2000, 2000)
local IsChunkLoaded
local Height
IsChunkLoaded, Height = Player:GetWorld():TryGetHeight(X, Z)
Player:TeleportToCoords(X, Height, Z)
Player:SendMessage(cChatColor.Yellow .. "Cords")
Player:SendMessage("X: " .. X)
Player:SendMessage("Y: " .. Y)
Player:SendMessage("Z: " .. Z)
end
return true
end