Advertisement
Guest User

NEW LINK!! Lotto Script - MrSavage

a guest
Apr 25th, 2019
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.19 KB | None | 0 0
  1. local lt = {}
  2. local owner = "MrSavage"
  3.  
  4. function OnPlayerChat(player,text)
  5. wp = tonumber(GetPlayerVariable(player,1))
  6. pp = GetParkVariable(1)
  7. g4 = GetPlayerVariable(player,4)
  8.  
  9. for y=1,6,1 do
  10. lt[y] = GetRandomNumber(1,49)
  11. end
  12.  
  13. if text == "!lotto" and wp >= 50 and g4 ~= " " then
  14. SetPlayerVariable(player,1,wp-50)
  15. SetPlayerVariable(player,5,0)
  16. dlt = "^9 - "
  17. for i=1,6,1 do
  18. ar = GetRandomNumber(1,49)
  19. 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
  20. lt[i] = ar
  21. dlt = dlt.."^6#"..lt[i].." ^9- "
  22. 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
  23. lt[i] = ar
  24. dlt = dlt.."^6#"..lt[i].." ^9- "
  25. else
  26. dlt = dlt.."^6#"..lt[i].." ^9- "
  27. end
  28. end
  29. lrt = "- [^9Lotto^7]\n^9 - - - Lotto Result Numbers^9 - - - \n"..dlt
  30. ConsoleMessage(player,lrt)
  31.  
  32. c = 0
  33.  
  34. nt = {}
  35. nlr,nrr = -1,0
  36. for t=1,6,1 do
  37. nt[t] = tonumber(g4:sub(nlr+2,nrr+2))
  38. nlr = nlr + 2
  39. nrr = nrr + 2
  40. end
  41. for n=1,6,1 do
  42. if nt[1] == lt[n] then
  43. c = c + 1
  44. elseif nt[2] == lt[n] then
  45. c = c + 1
  46. elseif nt[3] == lt[n] then
  47. c = c + 1
  48. elseif nt[4] == lt[n] then
  49. c = c + 1
  50. elseif nt[5] == lt[n] then
  51. c = c + 1
  52. elseif nt[6] == lt[n] then
  53. c = c + 1
  54. end
  55. end
  56. d = tonumber(GetPlayerVariable(player,5))
  57. ConsoleMessage(player,"You have c-guess : "..c)
  58. SetPlayerVariable(player,4," ")
  59. pl = 0
  60. wp = tonumber(GetPlayerVariable(player,1))
  61.  
  62. rp = {20,50,150,1000,2500,pp}
  63.  
  64. for r=1,6,1 do
  65. if c == r then
  66. SetPlayerVariable(player,1,wp+rp[r])
  67. pl = rp[r]
  68. end
  69. end
  70.  
  71. if c == 0 then
  72. SetPlayerVariable(player,1,wp+0)
  73. pl = 0
  74. end
  75. rms = "^9"..player.." received ^2$"..pl
  76. ConsoleMessageAllPlayers(rms)
  77.  
  78. elseif text == "!lotto" and wp < 50 then
  79. im = "- [^1Error^7]\n^9! : ^1Insufficient Balance. Please top-up."
  80. ConsoleMessage(player,im)
  81. elseif text == "!lotto" and g4 == " " then
  82. em = "- [^6Missing Numbers^7]\n^9! : ^6Set your lucky numbers first."
  83. ConsoleMessage(player,em)
  84. AbortEvent()
  85. end
  86.  
  87. if text:find("!set:") then
  88. gs = text:sub(6,text:len())
  89. SetPlayerVariable(player,4,gs)
  90. tg = {}
  91. tlg,trg = -1,0
  92. tr = ""
  93. for g=1,6,1 do
  94. tg[g] = gs:sub(tlg+2,trg+2)
  95. tlg = tlg + 2
  96. trg = trg + 2
  97. if g <= 5 then
  98. tr = tr.."^6#"..tg[g].." ^9- "
  99. else
  100. tr = tr.."^6#"..tg[g]
  101. end
  102. end
  103. lcr = "- [^8Ticket^7]^9\n - - - "..player.." ^2Lucky ^6Numbers ^9- - - \n"..tr
  104. ConsoleMessageAllPlayers(lcr)
  105. AbortEvent()
  106. end
  107.  
  108. if text == "!wallet" then
  109. wm = "- [Wallet]\n^9Wallet : ^2$"..wp
  110. ConsoleMessage(player,wm)
  111. AbortEvent()
  112. end
  113.  
  114. g1 = tonumber(GetPlayerVariable(player,1))
  115. if text:find("!sw") and player == owner then
  116. local df = text:find("-")
  117. pn = text:sub(df+1,text:len())
  118. ws = tonumber(text:sub(4,df-1))
  119. wf = g1 + ws
  120. SetPlayerVariable(pn,1,wf)
  121. pws = "^9Current Wallet : ^2$"..wf
  122. ConsoleMessage(pn,pws)
  123. AbortEvent()
  124. end
  125.  
  126. if text:find("!sp") and player == owner then
  127. ps = tonumber(text:sub(4,text:len()))
  128. SetParkVariable(1,ps)
  129. wps = "^9Current Prize Pool : ^2$"..ps
  130. ConsoleMessageAllPlayers(wps)
  131. AbortEvent()
  132. end
  133.  
  134. end
  135.  
  136. function OnPlayerEnterPark(player)
  137. SetPlayerVariable(player,4," ")
  138. SetPlayerVariable(player,5,0)
  139. SetPlayerVariable(player,1,0)
  140. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement