Hello,
I am currently using a script which does the following:
(raid scripts)
Create a monster and remove a magic wall through a "raid" which is only for 5 hours and if no one kills it, the monster disappears and the magic wall is created again in the same position after 5 hours.
- The problem is that the monster (it works perfectly) is created in the indicated position and after 5 hours the monster is eliminated.
But the magic wall : it is removed but " it is not created again after 5 hours...
PS : if instead of 5 hours I write 1 minute " local timeToRemove = 1"
everything works perfectly.
Where can be the fault if after 5 hours everything does not work, but after 1 minute everything works correctly?
thanks
nothing?
I am currently using a script which does the following:
(raid scripts)
Create a monster and remove a magic wall through a "raid" which is only for 5 hours and if no one kills it, the monster disappears and the magic wall is created again in the same position after 5 hours.
- The problem is that the monster (it works perfectly) is created in the indicated position and after 5 hours the monster is eliminated.
But the magic wall : it is removed but " it is not created again after 5 hours...
PS : if instead of 5 hours I write 1 minute " local timeToRemove = 1"
everything works perfectly.
Where can be the fault if after 5 hours everything does not work, but after 1 minute everything works correctly?
thanks
Lua:
local mwallPos = Position(32991, 32299, 7)
local mwallId = 1498
local timeToRemove = 300 -- 300 minutes / 5 hours
function onRaid()
Game.broadcastMessage("The portal Of Bazir on Bosses Quest Room It's open for 5 hours, access from DP THAIS!", MESSAGE_EVENT_ADVANCE)
local monster = Game.createMonster("Bazir", Position(33052, 32304, 7))
monster:setReward(true)
local item = Tile(mwallPos):getItemById(mwallId)
if item then
item:remove()
end
addEvent(removeBossCreateMwall, timeToRemove * 60 * 1000, monster:getId())
end
function removeBossCreateMwall(monsterId)
local item = Tile(mwallPos):getItemById(mwallId)
if not item then
Game.createItem(mwallId, 1, mwallPos)
end
local boss = Monster(monsterId)
if boss then
boss:remove()
end
end
Post automatically merged:
nothing?
Last edited: