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

Small issue

Rwynoha

New Member
Joined
Jan 20, 2015
Messages
14
Reaction score
0
i've edit this script to add special level for it and its working fine but i got small issue and its when i use this scroll on low level like 40 its says You can't use the teleport scroll if you pz locked but i'm already not pz i need it to say sorry you don't have enough level ,sorry but i'm still learning :D
sorry for my English
Code:
local newpos = {x=1000, y=1000, z=7}
function onUse(cid, item, frompos, item2, topos)
local inFight = hasCondition(cid, CONDITION_INFIGHT)
local delay = 76000 -- random storage
    if not inFight and getPlayerStorageValue(cid, delay) <= os.time() and getPlayerLevel(cid) >= 50 then
        doSendMagicEffect(getPlayerPosition(cid), 65)
        doTeleportThing(cid,newpos)
        doCreatureSay(cid, "TELEPORTED!!" , TALKTYPE_ORANGE_1)
        setPlayerStorageValue(cid, delay, os.time() + 60)
    elseif getPlayerStorageValue(cid, delay) >= os.time() then
    doPlayerSendCancel(cid, "You are exhausted. You can only use once per minute!")
    else
    doPlayerSendCancel(cid, "You can't use the teleport scroll if you are PZ LOCKED!!")
    end
return true
end
 
i've edit this script to add special level for it and its working fine but i got small issue and its when i use this scroll on low level like 40 its says You can't use the teleport scroll if you pz locked but i'm already not pz i need it to say sorry you don't have enough level ,sorry but i'm still learning :D
sorry for my English
Code:
local newpos = {x=1000, y=1000, z=7}
function onUse(cid, item, frompos, item2, topos)
local inFight = hasCondition(cid, CONDITION_INFIGHT)
local delay = 76000 -- random storage
    if not inFight and getPlayerStorageValue(cid, delay) <= os.time() and getPlayerLevel(cid) >= 50 then
        doSendMagicEffect(getPlayerPosition(cid), 65)
        doTeleportThing(cid,newpos)
        doCreatureSay(cid, "TELEPORTED!!" , TALKTYPE_ORANGE_1)
        setPlayerStorageValue(cid, delay, os.time() + 60)
    elseif getPlayerStorageValue(cid, delay) >= os.time() then
    doPlayerSendCancel(cid, "You are exhausted. You can only use once per minute!")
    else
    doPlayerSendCancel(cid, "You can't use the teleport scroll if you are PZ LOCKED!!")
    end
return true
end
Code:
local newpos = {x=1000, y=1000, z=7}
local player = {
    minLevel = 50,
    delay = 76000
}
function onUse(cid, item, frompos, item2, topos)
    if getPlayerLevel(cid) >= player.minLevel then
        if not hasCondition(cid, CONDITION_INFIGHT) then
            if getPlayerStorageValue(cid, player.delay) <= os.time() then
                doSendMagicEffect(getPlayerPosition(cid), 65)
                doTeleportThing(cid, newpos)
                doCreatureSay(cid, "TELEPORTED!!" , TALKTYPE_ORANGE_1)
                setPlayerStorageValue(cid, player.delay, os.time() + 60)
            else
                doPlayerSendCancel(cid, "You are exhausted. You can only use once per minute!")
                return false
            end
        else
            doPlayerSendCancel(cid, "You can't use the teleport scroll if you are PZ LOCKED!!")
            return false
        end
    else
        doPlayerSendCancel(cid, "You need to be atleast level "..player.minLevel.." to use this.")
        return false
    end
    return true
end
 
Last edited:
Back
Top