Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local args = {...}
- local API = args[1]
- local user = args[2]
- local mode = tonumber(args[3])
- local amount = tonumber(args[4])
- if API.getLottoRunning() then
- if amount > 0 then
- if API.getLBC( user ) >= amount then
- if not API.LottoUsers[user] then
- API.LottoUsers[user] = 0
- end
- for i=1,amount do
- table.insert(API.LottoTickets, user)
- end
- API.LottoUsers[user] = API.LottoUsers[user] + amount
- API.message( mode, user, "You added ".. amount .." LittleBigCoins to the pot!")
- for k,v in pairs(API.LottoUsers) do
- print("Telling")
- API.tell( k, "You currently have a ".. (math.floor(v)/#API.LottoTickets)*(100) .."% chance to win!")
- end
- API.setLBC( user, API.getLBC(user) - amount )
- else
- API.message( mode, user, "You can't put in more LBC than you have!")
- end
- else
- API.message( mode, user, "You can't enter a negative or nonpositive amount of money!")
- end
- else
- API.message( mode, user, "No lotto is running, user '..startlotto <time>' to make one!")
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement