Hello, when i kill the boss, teleport will be create only on 20 secounds, after 20 secounds teleport will be remove, so it isn't remove
i add, all flags, words etc. etc.!!
error must be in this script.
REP++
Code:
function onDeath(cid, corpse, killer)
registerCreatureEvent(cid, "zruglocktp") -- Eventname
local creaturename = getCreatureName(cid)
local in_pos = {x=1251, y=184, z=10, stackpos=2} -- Teleport pos
local checkIID = getThingfromPos(in_pos)
local to_pos = {x=1254, y=184, z=10, stackpos=1} -- Reward room? pos
local time_to_pass = 20 -- in seconds
local tpID = 1387
if creaturename == 'Zruglock' then -- Creature name
teleport = doCreateTeleport(tpID, to_pos, in_pos)
doSendMagicEffect(in_pos, CONST_ME_TELEPORT)
doCreatureSay(cid, "You have 20 seconds to enter the teleport before it is closed.", TALKTYPE_ORANGE_1)
addEvent(removeTeleport4, (time_to_pass*1000))
end
end
function removeTeleport4()
if getThingfromPos({x=1251, y=184, z=10, stackpos=1}).itemid == 1387 then -- Teleport pos all 3 lines
doRemoveItem(getThingfromPos({x=1251, y=184, z=10, stackpos=1}).uid,2)
doSendMagicEffect({x=1251, y=184, z=10, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end
i add, all flags, words etc. etc.!!
error must be in this script.
REP++