przemek1991
New Member
- Joined
- Feb 17, 2008
- Messages
- 25
- Reaction score
- 0
Hi, i have a problem, when i kill boss the teleport dont disappear after 3minutes, its still there and everybody can go through it.
(i make time 10sec to check faster...) using tfs 0.2.5 plz help, i give REP++
Lua:
function onDeath(cid, corpse, killer)
registerCreatureEvent(cid, "ushurielTeleport")
local creaturename = getCreatureName(cid)
local in_pos = {x=33175, y=31728, z=11, stackpos=2}
local checkIID = getThingfromPos(in_pos)
local to_pos = {x=33068, y=31785, z=13, stackpos=1}
local time_to_pass = 10 -- in seconds
local tpID = 1387
if creaturename == 'ushuriel' then
teleport = doCreateTeleport(tpID, to_pos, in_pos)
doSendMagicEffect(in_pos, CONST_ME_TELEPORT)
doCreatureSay(cid, "You now have 3 minutes to exit this room through the teleporter. It will bring you to the next room only during this time or the teleporter will disappear", TALKTYPE_ORANGE_1)
addEvent(removeTeleport, (1000*time_to_pass))
end
end
local function removeTeleport()
if getThingfromPos({x=33175, y=31728, z=11, stackpos=1}).itemid == 1387 then
doRemoveItem(getThingfromPos({x=33175, y=31728, z=11, stackpos=1}).uid,1)
doSendMagicEffect({x=33175, y=31728, z=11, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end