local wins = {3515, 2897, 2893, 4018, 2371} -- Change to item ids of items you can win
local chance = 5 -- 20% chance to win
local cost = 10000
function onUse(cid, item, fromPosition, itemEx, toPosition)
local i = wins[math.random(1, #wins)]
if doPlayerRemoveMoney(cid, cost) then
if math.random(1, chance) == 1 then
doPlayerAddItem(cid, i)
doPlayerSendTextMessage(cid, 22, "You won a " .. getItemNameById(i) .. "!")
else
doPlayerSendTextMessage(cid, "You didn't win anything.")
end
else
doPlayerSendCancel(cid, "You don't have enough money to gamble.")
end
return true
end