lucastiond
New Member
- Joined
- Jul 14, 2013
- Messages
- 35
- Reaction score
- 0
Hello guys.
I would like to know how can I check if a player have one storage value in an onAddItem function.
I'm using tfs 1.2
My script is like this:
The problem is that i can't get this "getStorageValue" function to work.
Thanks for your time.
I would like to know how can I check if a player have one storage value in an onAddItem function.
I'm using tfs 1.2
My script is like this:
Code:
local trees = {Position(33205, 32537, 6)}
function onAddItem(moveitem, tileitem, position)
if moveitem.itemid ~= 2419 then
return true
end
for i = 1, #trees do
local scimitarItem = Tile(trees):getItemById(2419)
local scimitarItem2 = Tile(trees):getItemById(5858)
if not scimitarItem2 and Game.getStorageValue(46140) == 1 then
Game.createItem(5858, 1, Position(33205, 32537, 6))
trees:sendMagicEffect(CONST_ME_MAGIC_BLUE)
scimitarItem:remove()
end
end
return true
end
The problem is that i can't get this "getStorageValue" function to work.
Thanks for your time.
Last edited by a moderator: