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

Click on Item and teleport me Guys Help me

jareczekjsp

Member
Joined
Jan 30, 2023
Messages
202
Reaction score
11
GitHub
Jarek123
Hello guys I have a problem i can't find the script
I hung a mirror with ID 9656 on the wall, I would like it to teleport the player to the hunting ground after clicking on the mirror and after 4 hours to throw him to the temple I found a few scripts but they don't work for me, would someone be so kind and help me?ots 8.6 OTX engine
 
I just assumed it's OTX2 (The only one I know for 8.6) and wrote this based on 0.x functions, If it's something else write and I will change it to some 1.x functions.
Lua:
local config = {
    teleportPosition = {x = 32365, y = 32233, z = 7},
    fromPos = {x = 32367, y = 32231, z = 7},
    toPos = {x = 32369, y = 32231, z = 7},
    kickTime = 4 * 60 * 60 * 1000
}

function onUse(cid, item, fromPosition, itemEx, toPosition)
    doTeleportThing(cid, config.teleportPosition)
    doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
    doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "You will be kicked out after 4 hours.")
    addEvent(
        function(cid)
            if not isPlayer(cid) then
                return true
            end
            if isInArea(getPlayerPosition(cid), config.fromPos, config.toPos) then
                doTeleportThing(cid, getTownTemplePosition(getPlayerTown(cid)))
                doSendMagicEffect(getThingPos(cid), CONST_ME_TELEPORT)
                doPlayerSendTextMessage(cid, MESSAGE_EVENT_ADVANCE, "Time out!")
            end
        end,
        config.kickTime,
        cid
    )
    return true
end
 
Last edited:
Back
Top