Guerra
Member
Hello everyone!!
I have a system on my server that are small gift bags that drop from monsters and drop random items for players. I would like to be able to control the quantity of each item that will be delivered to the player and also add the description of the drawn item to the name of the player who won it.
below follows the script I use, I ask for help to modify it !!
I have a system on my server that are small gift bags that drop from monsters and drop random items for players. I would like to be able to control the quantity of each item that will be delivered to the player and also add the description of the drawn item to the name of the player who won it.
below follows the script I use, I ask for help to modify it !!
LUA:
local items = {31617, 31618, 31619, 31620, 6508,}
local chancenada = 50
function onUse(cid, item)
if math.random(1, 100) <= chancenada then
doPlayerSendCancel(cid, "Falha!! Mais sorte da proxima vez...")
doRemoveItem(item.uid, 1)
return true
end
doPlayerAddItem(cid, items[math.random(1, #items)], 1)
doRemoveItem(item.uid, 1)
return true
end

