samuelav3
Member
- Joined
- Aug 18, 2014
- Messages
- 95
- Reaction score
- 5
I need help, this item when you click-on backpack disappears
but when I click-on the floor it no disappears
gooey.lua
but when I click-on the floor it no disappears
gooey.lua
Code:
local config = {
[35] = {15546, 1},
[31] = {15492, 1},
[32] = {9971, 1},
[33] = {7591, 2},
[34] = {7590, 2},
[30] = {2152, 2},
[36] = {15487, 10},
[37] = {5022, 1},
[38] = {2144, 2},
}
function onUse(cid, item)
local chance_growing = {}
for chance, _ in pairs(config) do
table.insert(chance_growing, chance)
end
table.sort(chance_growing, function(a, b) return a > b end)
local chance = 0
for _, v in pairs(chance_growing) do
if math.random(100) < v then
chance = v
break
end
end
local item = config[chance]
if item then
doPlayerAddItem(cid, item[1])
doPlayerRemoveItem(cid, 15572,1)
doSendMagicEffect(getThingPos(cid), 13)
doRemoveItem(item.uid, 1)
else
end
return true
end