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

i need help with storage values

Angel Of Death

Rise Of Tibia ServerOwner
Joined
Mar 12, 2012
Messages
91
Reaction score
0
LUA:
if value == getPlayerStorageValue(cid, 60055) then
		doCreatureSay(cid, getCreatureName(cid).. ' rolled a ' .. storage .. '.', TALKTYPE_ORANGE_1) -- this line is just to see if its working it will add money when it works
		else
			npcHandler:say("Please Try Again", cid, 1000)
		end

i need it to get the local value number and if the player storage = the value number it will add money to the player
 
I don't know what exactly you need help with or how you want the script done.

But if you want it to work the way it is in your post, the value has to equal the value of 60055.
In common cases, the value is 1. It depends on what you set the value to that storageID.
 
LUA:
   local value = math.random(5792, 5797)
it rolls the dice and gets a 1/6 so say the person pick the number 3 it sets there storage to 3 and if the value lands on 3 the player gets money if not nothing happens

- - - Updated - - -

i fixed it

is it possible to remove an item from a container and add it to a player
 
Fix It guys He get to me Error In Engine


-- function SendAnmi(cid)
-- stone_pos={x=562,y=1591,z=8,stackpos=1}
-- num = getGlobalStorageValue(98575)
-- stone = getThingfromPos(stone_pos)
-- if stone.itemid == 6966 then
-- --if num>0 then
-- -- setGlobalStorageValue(98575, -1)
-- -- end
-- else


-- num = num -1
-- n = num + 17
-- doSendAnimatedText(stone_pos, "".. n .."", TEXTCOLOR_RED)
-- if num == 0 then
-- num=17
-- end
-- setGlobalStorageValue(98575, num)

-- end
-- end




function onStepIn(cid, item, pos)
pos1={x=556,y=1580,z=8,stackpos=1}
pos2={x=568,y=1589,z=8,stackpos=1}
stone_pos={x=562,y=1591,z=8,stackpos=1}
stone = getThingfromPos(stone_pos)
local found = nil
local player=nil
for arenax = pos1.x, pos2.x do
for arenay = pos1.y, pos2.y do
for sp=0,253 do
arenapos = {x=arenax, y=arenay, z=pos1.z, stackpos=sp}
slain1 = getThingfromPos(arenapos)

if slain1.itemid == 3028 then
found = true
x=slain1.duration

end
end
end
end



if found and stone.itemid == 6966 then
doRemoveItem(stone.uid,1)
doSendMagicEffect(stone_pos, 41)

for arenax = pos1.x, pos2.x do
for arenay = pos1.y, pos2.y do
for sp=0,253 do
arenapos = {x=arenax, y=arenay, z=pos1.z, stackpos=sp}
slain1 = getThingfromPos(arenapos)

if slain1.itemid == 3028 then


for x = 1, 15 do

end
end
end
end
end
end


if found ~=true and stone.itemid ~= 6966 then
doCreateItem(cid,6966,1,stone_pos)
doSendMagicEffect(stone_pos, 43)
end

end
 
Back
Top