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

Lua little script

Lbtg

Advanced OT User
Joined
Nov 22, 2008
Messages
2,398
Reaction score
165
Hello can someone help me with this script i want to upgrade it so if player with Storage 3333 click it he gets teleported , but if player doesnt have the 3333 storage he gets message ' your not allowed to go here'

script here
Code:
function onUse(cid, item, frompos, item2, topos)
if item.uid == 7966 then
if item.itemid == 8422 then

nplayer1pos = {x=1561, y=648, z=6}

doTeleportThing(cid,nplayer1pos)
doSendMagicEffect(nplayer1pos,10)

end
end
return 1
end

Kind Regards
Lucas
 
Code:
function onUse(cid, item, frompos, item2, topos)
    if item.itemid == 8422 then
        if item.uid == 7966 then
            if getPlayerStorageValue(cid, 3333) >= 1 then
                local nplayer1pos = {x = 1561, y = 648, z = 6}
                doTeleportThing(cid, nplayer1pos)
                doSendMagicEffect(nplayer1pos, 10)
            else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You\'re not allowed to go here')
            end
        end
    end
    return true
end
 
Code:
function onUse(cid, item, frompos, item2, topos)
local level = getPlayerLevel(cid)
    if item.itemid == 8422 then
        if item.uid == 7966 then
            if level >= 1 then
                local nplayer1pos = {x = 1561, y = 648, z = 6}
                doTeleportThing(cid, nplayer1pos)
                doSendMagicEffect(nplayer1pos, 10)
            else
                doPlayerSendTextMessage(cid, MESSAGE_STATUS_WARNING, 'You\'re not allowed to go here')
            end
        end
    end
    return true
end
 
Back
Top