johnsamir
Advanced OT User
Hi
I'm using this script at my server GlobalEvent - Change Map [TFS 1.X] (https://otland.net/threads/change-map-tfs-1-x.227517/) it does work very good. The problem is that, have other events in server, and the problem is that when an event is on going and the global event change the map it moves all players, i want to add an exception for the event, like for example is playing is standing in nologout tile it wont be teleport it will be excluded from the change map event or if you have a better idea on how to do this please point it out. is this possible? can you tell me how to do it, please?
thank
have made this
and im getting this error
I'm using this script at my server GlobalEvent - Change Map [TFS 1.X] (https://otland.net/threads/change-map-tfs-1-x.227517/) it does work very good. The problem is that, have other events in server, and the problem is that when an event is on going and the global event change the map it moves all players, i want to add an exception for the event, like for example is playing is standing in nologout tile it wont be teleport it will be excluded from the change map event or if you have a better idea on how to do this please point it out. is this possible? can you tell me how to do it, please?
thank
Post automatically merged:
have made this
Lua:
local town = Town(Game.getStorageValue(config.globalStorage))
local position = town:getTemplePosition()
for i = 1, #players do
local player = players[i]
local tile = hasFlag(TILESTATE_PVPZONE)
if not tile then
player:setTown(town)
player:teleportTo(position)
player:addHealth(player:getMaxHealth())
player:addMana(player:getMaxMana())
player:sendTextMessage(MESSAGE_STATUS_WARNING, "The map has been changed to ".. towns .."Next map change will be in 30 minutes! Type !shop list to view the items available in shop!")
end
end
Code:
data/globalevents/scripts/changeMap.lua:onThink
data/globalevents/scripts/changeMap.lua:28: attempt to call global 'hasFlag' (a nil value)
stack traceback:
[C]: in function 'hasFlag'
data/globalevents/scripts/changeMap.lua:28: in function <data/globalevents/scripts/changeMap.lua:12>
[Error - GlobalEvents::think] Failed to execute event: ChangeMap
Lua Script Error: [GlobalEvent Interface]
data/globalevents/scripts/changeMap.lua:onThink
data/globalevents/scripts/changeMap.lua:28: attempt to call global 'hasFlag' (a nil value)
stack traceback:
[C]: in function 'hasFlag'
data/globalevents/scripts/changeMap.lua:28: in function <data/globalevents/scripts/changeMap.lua:12>
[Error - GlobalEvents::think] Failed to execute event: ChangeMap
Last edited: