• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

edite my teleport

Nerevr back

Member
Joined
Nov 7, 2014
Messages
269
Reaction score
7
i have this script i want to edite it
whan player use teleport and than move the teleport stop or if he lots items from bp teleport stop too
Code:
function count(name,time,pos)
    local cid = getCreatureByName(name)
    if cid then
        if not (getCreatureCondition(cid,CONDITION_INFIGHT)) and not (isPlayerPzLocked(cid)) then
            if time > 0 then
                doPlayerSendTextMessage(cid,MESSAGE_TYPES["green"],"You will be teleported in ".. time .. " seconds.")
                addEvent(count,2*1000, name, time - 2, pos)
            else
                doTeleportThing(cid,pos,false)
                doSendMagicEffect(getThingPos(cid),10)
            end
        else
            doPlayerSendTextMessage(cid,MESSAGE_TYPES["green"],"Teleport to temple cancelled as you have battle sign.")
        end
    end
    return true
end

function onUse(cid, item, fromPosition, itemEx, toPosition)
    local scrollid = 2348 -- Id of your rune.
    local temple = getPlayerMasterPos(cid) -- Dont touch


    if getPlayerStorageValue(cid, 1338) >= os.time() then
        doPlayerSendTextMessage(cid,MESSAGE_TYPES["green"],"You can't use this item while you are jailed")
        return true
    end
  
    local coolDown = os.time() - getPlayerStorageValue(cid, 1338)
    if coolDown < 300 then
        doPlayerSendTextMessage(cid,MESSAGE_TYPES["green"],"Your teleporter is in cooldown of 5 minutes. Please wait.")
        return true
    end

    if (getCreatureCondition(cid,CONDITION_INFIGHT)) or (isPlayerPzLocked(cid)) then
        doPlayerSendTextMessage(cid,MESSAGE_TYPES["green"],"You can't use this while you are in battle.")
        return true
    end
    count(getCreatureName(cid),10,temple)
    setPlayerStorageValue(cid,1338, os.time())
    return true
end
tfs 0.4
 
Last edited:
Hes saying when you use his "Teleport Item" it does a countdown from 10 and he wants it if the player is pushed or if he walks away the teleport countdown stops.
 
Hes saying when you use his "Teleport Item" it does a countdown from 10 and he wants it if the player is pushed or if he walks away the teleport countdown stops.
yes and when you use his "Teleport Item" it does a countdown from 10 and i wants it if i moved items from bp countdown stop @Limos
 
Last edited:
i see no for loop in function.
But what i would do is: every second check is the player position same when you started the script.
if not then
stopEvent(countdown)
stopEvent(teleport)
 
Back
Top