Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local lt = {}
- local owner = "MrSavage"
- function OnPlayerChat(player,text)
- wp = tonumber(GetPlayerVariable(player,1))
- pp = GetParkVariable(1)
- g4 = GetPlayerVariable(player,4)
- for y=1,6,1 do
- lt[y] = GetRandomNumber(1,49)
- end
- if text == "!lotto" and wp >= 50 and g4 ~= " " then
- SetPlayerVariable(player,1,wp-50)
- SetPlayerVariable(player,5,0)
- dlt = "^9 - "
- for i=1,6,1 do
- ar = GetRandomNumber(1,49)
- if lt[1] == lt[2] or lt[1] == lt[3] or lt[2] == lt[3] or lt[4] == lt[5] or lt[4] == lt[6] or lt[5] == lt[6] or lt[1] == lt[4] or lt[2] == lt[4] or lt[3] == lt[4] then
- lt[i] = ar
- dlt = dlt.."^6#"..lt[i].." ^9- "
- elseif lt[1] == lt[5] or lt[2] == lt[5] or lt[3] == lt[5] or lt[1] == lt[6] or lt[2] == lt[6] or lt[3] == lt[6] or lt[3] == lt[4] then
- lt[i] = ar
- dlt = dlt.."^6#"..lt[i].." ^9- "
- else
- dlt = dlt.."^6#"..lt[i].." ^9- "
- end
- end
- lrt = "- [^9Lotto^7]\n^9 - - - Lotto Result Numbers^9 - - - \n"..dlt
- ConsoleMessage(player,lrt)
- c = 0
- nt = {}
- nlr,nrr = -1,0
- for t=1,6,1 do
- nt[t] = tonumber(g4:sub(nlr+2,nrr+2))
- nlr = nlr + 2
- nrr = nrr + 2
- end
- for n=1,6,1 do
- if nt[1] == lt[n] then
- c = c + 1
- elseif nt[2] == lt[n] then
- c = c + 1
- elseif nt[3] == lt[n] then
- c = c + 1
- elseif nt[4] == lt[n] then
- c = c + 1
- elseif nt[5] == lt[n] then
- c = c + 1
- elseif nt[6] == lt[n] then
- c = c + 1
- end
- end
- d = tonumber(GetPlayerVariable(player,5))
- ConsoleMessage(player,"You have c-guess : "..c)
- SetPlayerVariable(player,4," ")
- pl = 0
- wp = tonumber(GetPlayerVariable(player,1))
- rp = {20,50,150,1000,2500,pp}
- for r=1,6,1 do
- if c == r then
- SetPlayerVariable(player,1,wp+rp[r])
- pl = rp[r]
- end
- end
- if c == 0 then
- SetPlayerVariable(player,1,wp+0)
- pl = 0
- end
- rms = "^9"..player.." received ^2$"..pl
- ConsoleMessageAllPlayers(rms)
- elseif text == "!lotto" and wp < 50 then
- im = "- [^1Error^7]\n^9! : ^1Insufficient Balance. Please top-up."
- ConsoleMessage(player,im)
- elseif text == "!lotto" and g4 == " " then
- em = "- [^6Missing Numbers^7]\n^9! : ^6Set your lucky numbers first."
- ConsoleMessage(player,em)
- AbortEvent()
- end
- if text:find("!set:") then
- gs = text:sub(6,text:len())
- SetPlayerVariable(player,4,gs)
- tg = {}
- tlg,trg = -1,0
- tr = ""
- for g=1,6,1 do
- tg[g] = gs:sub(tlg+2,trg+2)
- tlg = tlg + 2
- trg = trg + 2
- if g <= 5 then
- tr = tr.."^6#"..tg[g].." ^9- "
- else
- tr = tr.."^6#"..tg[g]
- end
- end
- lcr = "- [^8Ticket^7]^9\n - - - "..player.." ^2Lucky ^6Numbers ^9- - - \n"..tr
- ConsoleMessageAllPlayers(lcr)
- AbortEvent()
- end
- if text == "!wallet" then
- wm = "- [Wallet]\n^9Wallet : ^2$"..wp
- ConsoleMessage(player,wm)
- AbortEvent()
- end
- g1 = tonumber(GetPlayerVariable(player,1))
- if text:find("!sw") and player == owner then
- local df = text:find("-")
- pn = text:sub(df+1,text:len())
- ws = tonumber(text:sub(4,df-1))
- wf = g1 + ws
- SetPlayerVariable(pn,1,wf)
- pws = "^9Current Wallet : ^2$"..wf
- ConsoleMessage(pn,pws)
- AbortEvent()
- end
- if text:find("!sp") and player == owner then
- ps = tonumber(text:sub(4,text:len()))
- SetParkVariable(1,ps)
- wps = "^9Current Prize Pool : ^2$"..ps
- ConsoleMessageAllPlayers(wps)
- AbortEvent()
- end
- end
- function OnPlayerEnterPark(player)
- SetPlayerVariable(player,4," ")
- SetPlayerVariable(player,5,0)
- SetPlayerVariable(player,1,0)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement