it crashes the server after 60 seconds everything else works fine, summons mobs and makes the magic wall, it just doesnt disappear... I am using TFS 0.2.11
Code:
local playerPosition = {x = 976, y = 912, z = 8}
local newPosition = {x = 967, y = 911, z = 8}
local actionid = 6555
local time = 60
mob2pos = {x=963, y=908, z=8}
mob3pos = {x=963, y=914, z=8}
mob4pos = {x=959, y=911, z=8}
wallid = 1497
wallpos = {x=958, y=911, z=8, stackpos=1}
local lvl = 100
function onUse(cid, item, fromPosition, itemEx, toPosition)
if getPlayerLevel(cid) >= lvl then
doCreateItem(wallid,1,wallpos)
addEvent(doRemoveItem, time * 1000)
doTeleportThing(cid,newPosition)
doSummonCreature("Persian Warrior", mob2pos)
doSummonCreature("Persian Warrior", mob3pos)
doSummonCreature("Persian Warrior", mob4pos)
function removewall()
doRemoveItem(wallpos.uid,1)
doPlayerSendTextMessage(cid, 19, "The Magic Wall has disappeared.")
end
else
doPlayerSendTextMessage(cid, 19, "Sorry you need to be atleast level "..lvl.." to enter.")
end
return true
end