bpm91
Advanced OT User
- Joined
- May 23, 2019
- Messages
- 1,046
- Solutions
- 7
- Reaction score
- 180
- Location
- Brazil
- YouTube
- caruniawikibr
hello, I'm having problems, my script ignores the inventory and the capacity, and then they don't work, so it says I took it but it doesn't fall on the floor, and it doesn't come to the character either, so when I click again it's empty because the storage already been given
LUA:
function onUse(player, item, fromPosition, target, toPosition, isHotkey)
if player:getStorageValue(7475) ~= -1 then
player:sendTextMessage(MESSAGE_INFO_DESCR,"It's empty.")
return true
end
local bag = Game.createItem(5460, 1)
bag:addItem(2152, 10)
if player:getFreeCapacity() < bag:getWeight() then
player:sendTextMessage(MESSAGE_INFO_DESCR,"You need capacity!")
return true
end
if not player:addItemEx(bag) then
player:sendTextMessage(MESSAGE_INFO_DESCR,"You need inventory!")
return true
end
player:sendTextMessage(MESSAGE_INFO_DESCR, "You have found a Fur Backpack!")
player:setStorageValue(7475, 1)
return true
end
Last edited: