Hi, the time to kill the boss is 10 minutes.
How can I add that my time resets to zero when I leave?
The problem is that the overall time is not counted on one fight and often kick at a time
local function clearBossRoom()
-- if fighters are inside arena too long kick them --
if Game.getStorageValue(red_config.game_storage) == 1 then
local spectators = Game.getSpectators(red_config.boss_room_center, false, false, 13, 11, 12, 10)
for i = 1, #spectators do
local spectator = spectators
if spectator:isPlayer() then
spectator:teleportTo(red_config.room_exit_coord)
spectator:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
spectator:say('Time out! You were teleported out by strange forces.', TALKTYPE_MONSTER_SAY)
elseif spectator:isMonster() then
spectator:remove()
end
end
Game.setStorageValue(red_config.game_storage, 0)
end
end
exit
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
player:teleportTo(Position(4408, 4127, 7))
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
return true
end
How can I add that my time resets to zero when I leave?
The problem is that the overall time is not counted on one fight and often kick at a time
local function clearBossRoom()
-- if fighters are inside arena too long kick them --
if Game.getStorageValue(red_config.game_storage) == 1 then
local spectators = Game.getSpectators(red_config.boss_room_center, false, false, 13, 11, 12, 10)
for i = 1, #spectators do
local spectator = spectators
if spectator:isPlayer() then
spectator:teleportTo(red_config.room_exit_coord)
spectator:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
spectator:say('Time out! You were teleported out by strange forces.', TALKTYPE_MONSTER_SAY)
elseif spectator:isMonster() then
spectator:remove()
end
end
Game.setStorageValue(red_config.game_storage, 0)
end
end
exit
function onStepIn(creature, item, position, fromPosition)
local player = creature:getPlayer()
if not player then
return true
end
player:teleportTo(Position(4408, 4127, 7))
player:getPosition():sendMagicEffect(CONST_ME_TELEPORT)
return true
end