Hello!
I have a lottery system that you can play on my ot. I got the idea that if a player get something that is good, and rare to get through lottery, it should be broadcasted like so:
"playername just won gold nugget in lottery!"
I would like some kind of table to configure what items are considered "rare" and should be broadcasted upon winning them. like:~
local rare = {
2157, -- gold nugget
2390, -- magic longsword
10521} -- moon backpack
And if the player wins any of the "rare" it should be broadcasted ^^
Here's my script:
I didn't make this script, but I would be really happy if someone could help me expand it
I have a lottery system that you can play on my ot. I got the idea that if a player get something that is good, and rare to get through lottery, it should be broadcasted like so:
"playername just won gold nugget in lottery!"
I would like some kind of table to configure what items are considered "rare" and should be broadcasted upon winning them. like:~
local rare = {
2157, -- gold nugget
2390, -- magic longsword
10521} -- moon backpack
And if the player wins any of the "rare" it should be broadcasted ^^
Here's my script:
Code:
function onUse(cid, item, frompos, item2, topos)
local itemreq = 2157
local prize = {
2157,
2390,
2153,
2154,
2155,
10521,
2156}
local actionid = 1337
local count = 1
if item.actionid == actionid and getPlayerItemCount(cid, itemreq) >= 1 then
doPlayerRemoveItem(cid, itemreq, 1)
local randomChance = math.random(1, 7)
doPlayerAddItem(cid, prize[randomChance], count)
doSendMagicEffect(fromPosition, 27)
else
doPlayerSendCancel(cid, "You need a gold nugget to play the lottery.")
end
return true
end
Last edited: