• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua Error in script

skyzors

New Member
Joined
Jul 6, 2012
Messages
21
Reaction score
0
Hiho otlanders!


I have a script to open a TP when kill "x" monster but... it dont removing the TP when time over...

function onDeath(cid, corpse, killer)

registerCreatureEvent(cid, "kaliDead")

local creaturename = getCreatureName(cid)
local in_pos = {x=3373, y=3864, z=11, stackpos=2}
local checkIID = getThingfromPos(in_pos)
local to_pos = {x=3382, y=3857, z=12, stackpos=1}
local time_to_pass = 30 -- in seconds
local tpID = 1387

if creaturename == 'Kali' then

teleport = doCreateTeleport(tpID, to_pos, in_pos)

doSendMagicEffect(in_pos, CONST_ME_TELEPORT)

doCreatureSay(cid, "You have 30 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=3382, y=3857, z=12, stackpos=1}).itemid == 1387 then
doRemoveItem(getThingfromPos({x=3373, y=3864, z=11, stackpos=1}).uid,1)
doSendMagicEffect({x=3382, y=3857, z=12, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end


If someone can help me =)
 
Back
Top