Lbtg
Advanced OT User
- Joined
- Nov 22, 2008
- Messages
- 2,398
- Reaction score
- 165
the script works normaly after killing monatsr teleport comes up , but the thing is that after 120 seconds teleport isint deleted and it stays 4ever , can someone fix it so it works perfectly ?
Code:
registerCreatureEvent(cid, "Snake God Essence")
local creaturename = getCreatureName(cid)
local in_pos = {x = 347, y = 1365, z = 7, stackpos=2}
local checkIID = getThingfromPos(in_pos)
local to_pos = {x = 283, y = 1427, z = 7, stackpos=1}
local time_to_pass = 120 -- in seconds
local tpID = 1387
if creaturename == 'Snake God Essence' then
teleport = doCreateTeleport(tpID, to_pos, in_pos)
doSendMagicEffect(in_pos, CONST_ME_TELEPORT)
doCreatureSay(cid, "You have 120 seconds to enter the teleport before it is closed.", TALKTYPE_ORANGE_1)
addEvent(removeTeleport, (1000*time_to_pass))
end
end
function removeTeleport()
if getThingfromPos({x = 347, y = 1365, z = 7, stackpos=1}).itemid == 1387 then
doRemoveItem(getThingfromPos({x = 347, y = 1365, z = 7, stackpos=1}).uid,1)
return TRUE
end
end