• 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!

Remove teleport

jeffaklumpen

Member
Joined
Jan 20, 2022
Messages
76
Solutions
2
Reaction score
15
GitHub
jeffaklumpen
I have a script that causes a teleport to appear after you kill a certain boss. After 2 minutes the portal should disappear. The portal will appear but it stays forever. It used to work fine when I used TFS 0.3.6 but I switched to 0.4 and now the script won't work :/

Lua:
function onDeath(cid, corpse, killer)

    registerCreatureEvent(cid, "Zalzabane")

    local creaturename = getCreatureName(cid)
    local in_pos = {x=31954, y=32337, z=10, stackpos=2}
    local checkIID = getThingfromPos(in_pos)
    local to_pos = {x=31954, y=32326, z=10, stackpos=1}
    local time_to_pass = 120 -- in seconds
    local tpID = 1387

    if creaturename == 'Zalzabane' then

        teleport = doCreateTeleport(tpID, to_pos, in_pos)

        doSendMagicEffect(in_pos, CONST_ME_TELEPORT)

        doCreatureSay(cid, "Zalzabane is defeated! Hurry, get to the portal!", TALKTYPE_ORANGE_1)
        addEvent(removeTeleport, (1000*time_to_pass))

    
        end
        return TRUE
    end

function removeTeleport()
    if getThingfromPos({x=31954, y=32337, z=10, stackpos=1}).itemid == 1387 then
    doRemoveItem(getThingfromPos({x=31954, y=32337, z=10, stackpos=1}).uid,1)
    doSendMagicEffect({x=31954, y=32337, z=10, stackpos=1}, CONST_ME_POFF)
    return TRUE
    end
end
 
Imagine u switch from rotworm to rotworm 2.0
dont waste ur time and use tfs 1.x and you will receive more support too
Well I'm running a 8.6 server, from what I've read it doesn't go well with 1.x
Post automatically merged:

Just solved it. I needed to place the removeTeleport function above onDeath funcion.
 
Last edited:
Back
Top