local teleportAllAction = TalkAction("/tp all")
local effect = CONST_ME_TELEPORT
function teleportAllAction.onSay(player, words, param)
if player:getAccountType() < ACCOUNT_TYPE_GOD then
return false
end
for _, onlinePlayer in ipairs(Game.getPlayers()) do
local templePosition = onlinePlayer:getTown():getTemplePosition()
onlinePlayer:teleportTo(templePosition)
onlinePlayer:getPosition():sendMagicEffect(effect)
onlinePlayer:sendTextMessage(MESSAGE_STATUS_WARNING, "You have been teleported to your temple by " .. player:getName() .. ".")
end
return false
end
teleportAllAction:register()