Keshoo
Newer Rich
- Joined
- Feb 23, 2010
- Messages
- 166
- Reaction score
- 5
i have script that transfer players from position to other postion after x time but some time its not work as intended it can transfer players from temple and other far away places i dont know where is the problem
Lua:
local transferroom = GlobalEvent("transferoom")
function areaHasPlayer(center, radiusX, radiusY)
return #Game.getSpectators(center, false, true, radiusX, radiusX, radiusY, radiusY) > 0
end
local roomCenter = Position(32223, 32047, 14)
local radius = {6, 7}
local destination = Position(32207, 32053, 14)
function Dreamcourtsroom.onThink(interval)
for _, player in pairs(Game.getPlayers()) do
if not player or player:isInGhostMode() then
return true
end
if areaHasPlayer(roomCenter, unpack(radius)) then
player:teleportTo(destination)
end
end
return true
end
Dreamcourtsroom:interval(10000)
Dreamcourtsroom:register()