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

Action [TFS 1.2] Teleport Scroll

Lua:
savePos = {}

local function sendEffects(pos, eff, pid)
    if savePos[pid] then
        local player = Player(pid)
        if isPlayer(player) then
            pos:sendMagicEffect(eff, player)
            addEvent(sendEffects, 400, pos, eff, pid)
        end
    end
end

function onUse(player, item, fromPosition, target, toPosition, isHotkey)
    if player:getCondition(CONDITION_INFIGHT, CONDITIONID_DEFAULT) then
        player:sendCancelMessage('You cannot use this while in a fight.')
        player:getPosition():sendMagicEffect(CONST_ME_POFF)
        return true
    end
    local pid = player:getId()
    if not savePos[pid] then
        savePos[pid] = {player:getPosition()}
        player:teleportTo(player:getTown():getTemplePosition())
        local pos = player:getPosition()
        local randpos = Position(pos.x+math.random(3), pos.y+math.random(2), pos.z)
        savePos[pid] = {savePos[pid][1], randpos}
        local cache  = savePos[pid]
        sendEffects(cache[2], 12, pid)
        sendEffects(cache[1], 35, pid)
        local item = Item(Tile(randpos):getGround().uid)
        item:setActionId(3006)
        addEvent(function()
            if item:getActionId(3006) then
                item:removeAttribute('aid')
                savePos[pid] = nil
            end
        end, 30000)
    else
        player:sendTextMessage(MESSAGE_STATUS_CONSOLE_BLUE, 'You must enter your teleport first before you use this again.')
    end
    return true
end
when im in pz it tells me im in a fight xD
 
when im in pz it tells me im in a fight xD
battle lock lasts for 60 seconds by default.

Entering a protection zone does not remove your battle lock status, it simply hides it.
If you leave the pz, the battle sign will replace the pz sign, assuming it's been less then 60 seconds since you were last in battle.
 
battle lock lasts for 60 seconds by default.

Entering a protection zone does not remove your battle lock status, it simply hides it.
If you leave the pz, the battle sign will replace the pz sign, assuming it's been less then 60 seconds since you were last in battle.
ok after 60 seconds i tried to click it like you said, it doesnt do anything.. just open the scroll like its a normal scroll
 
ok after 60 seconds i tried to click it like you said, it doesnt do anything.. just open the scroll like its a normal scroll
Is there an error in the console?
 
oh now it works.. weird ty very much :D oh and btw there is a way to change the battle lock from 60 sec to less?
config.lua

find pzLocked = 60000

change 60000 to whatever you want. xP
 
config.lua

find pzLocked = 60000

change 60000 to whatever you want. xP
ty ty ty man :D
Post automatically merged:

config.lua

find pzLocked = 60000

change 60000 to whatever you want. xP
Bro sorry for asking, but do you know how to make that there is no cap limit for a player? i mean that even lvl 8 can carry a lot of items?
 
Last edited:
ty ty ty man :D
Post automatically merged:


Bro sorry for asking, but do you know how to make that there is no cap limit for a player? i mean that even lvl 8 can carry a lot of items?
data/xml/groups

change
XML:
<group id="1" name="player" access="0" maxdepotitems="0" maxvipentries="0" />
to
XML:
<group id="1" name="player" access="0" maxdepotitems="0" maxvipentries="0" >
    <flags>
        <flag hasinfinitecapacity="1" />
    </flags>
</group>
 
k ty :D
Post automatically merged:

data/xml/groups

change
XML:
<group id="1" name="player" access="0" maxdepotitems="0" maxvipentries="0" />
to
XML:
<group id="1" name="player" access="0" maxdepotitems="0" maxvipentries="0" >
    <flags>
        <flag hasinfinitecapacity="1" />
    </flags>
</group>
bro i started a converstion with you, can you please look at what i wrote to you and help me please?
 
Last edited:
I like how cipsoft monetized it (and coded a simpler version than this btw)
 
Last edited:
Back
Top