• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!
  • 2026 staff recruitment is open! Check it out and consider applying!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

GlobalEvent [TFS 1.x] Summon Recall (Floor Change)

BboyChaos

Member
Joined
May 20, 2014
Messages
10
Reaction score
7
Code:
function onThink(interval)

  for _, player in ipairs(Game.getPlayers()) do
    local player_position = player:getPosition()
    if not player_position:getTile():hasFlag(TILESTATE_PROTECTIONZONE) then
      local summons = player:getSummons()
      if #summons > 0 then
        for i = 1, #summons do
          if summons[i]:getPosition().z ~= player_position.z then
            summons[i]:teleportTo(player_position)
          end
        end
      end
    end
  end
  return true
end
 
Back
Top