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

Storage value

fire_shock666

New Member
Joined
Jun 3, 2014
Messages
24
Reaction score
0
Location
Netherlands
Hey guys i got a script that tp`s player when have a item on them,

is it possoble to add storage value to it so when the quest is done u dont need the item but you can always enter?
this is my script:

PHP:
function onStepIn(cid, item, pos)
    local position = {x=1634, y=1117, z=9}
    local position2 = {x=1631, y=1110, z=10}   
   
        if (getPlayerItemCount(cid, 6500) < 50) then
            doTeleportThing(cid, position)
            doSendMagicEffect(position,10)
        else

            doTeleportThing(cid, position2)
                        doSendMagicEffect(position2,10)
        end
end

tnx for helping me
 
Code:
local config = {
    teleportTo = {x=1634, y=1117, z=9},
    storageValue = 1000
}

function onStepIn(cid, item, position, fromPosition)
    if not isPlayer(cid) then
        return false
    end
  
        if getPlayerStorageValue(cid, config.storageValue) == 1 or getPlayerItemCount(cid, 6500) < 50 then
        doTeleportThing(cid, config.teleportTo)
                doSendMagicEffect(config.teleportTo, CONST_ME_TELEPORT)
        else
                doTeleportThing(cid, fromPosition)
                doSendMagicEffect(fromPosition, CONST_ME_TELEPORT)
        end
    return true
end
 
Code:
function onStepIn(cid, item, pos)
local position = {x=1634, y=1117, z=9}
local position2 = {x=1631, y=1110, z=10}

if doPlayerRemoveItem(cid, 6500, 50) then
doTeleportThing(cid, position)
doSendMagicEffect(position,10)
setPlayerStorageValue(cid, 33281, 1)
elseif getPlayerStorageValue(cid, 33281) >= 1 then
doTeleportThing(cid, position)
doSendMagicEffect(position, 10)
else
doTeleportThing(cid, position2)
doSendMagicEffect(position2,10)
end
end
 
Back
Top