Fragdonut
Banned User
I want this teleport to disepear after 20 seconds, however, it doesn't work.
Here's the script:
Here's the script:
Code:
function onDeath(cid, corpse, killer)
registerCreatureEvent(cid, "werewolfded")
local creaturename = getCreatureName(cid)
local in_pos = {x=1091, y=1652, z=7, stackpos=2}
local checkIID = getThingFromPos(in_pos)
local to_pos = {x=1125, y=1658, z=7, stackpos=1}
local time_to_pass = 2 -- in seconds
local tpID = 1387
if creaturename == 'The Werewolf' then
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(removeTeleport, (1000*2))
end
end
function removeTeleport()
if getThingFromPos({x=1091, y=1652, z=7, stackpos=2}).itemid == 1387 then
doRemoveItem(getThingFromPos({x=1091, y=1652, z=7, stackpos=1}).uid,1)
doSendMagicEffect({x=1091, y=1652, z=7, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end
Last edited: