• 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 Simple help, teleport don't remove

Adi69

Active Member
Joined
Mar 14, 2008
Messages
161
Reaction score
35
Location
Poland
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 :(


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++
 
There are scripts released here that work perfectly. You should search a little bit. :huh:
 
Back
Top