Advertisement
Guest User

Untitled

a guest
Mar 26th, 2020
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. local get = game.ServerStorage:WaitForChild("getmaterial")
  2.  
  3. local debounce = false
  4.  
  5.  
  6. function luckydraw()
  7. if debounce == false then
  8.  
  9. debounce = true
  10.  
  11. local luckynumber = math.random(1,131)
  12.  
  13. print (luckynumber)
  14.  
  15. local prize = {}
  16.  
  17. if luckynumber <= 50 then
  18.  
  19. prize = {"wood"}
  20.  
  21. elseif 50< luckynumber and luckynumber <= 90
  22.  
  23. then prize = {"stone"}
  24.  
  25. elseif 90 < luckynumber and luckynumber <= 100 then
  26. prize = {"diamonds"}
  27.  
  28. elseif 100< luckynumber and luckynumber<=120 then
  29.  
  30. prize = {"wood","stone"}
  31.  
  32. elseif 120< luckynumber and luckynumber<=125 then
  33.  
  34. prize = {"wood","diamond"}
  35.  
  36. elseif 125 < luckynumber and luckynumber <= 129 then
  37.  
  38. prize = {"stone","diamonds"}
  39.  
  40. end
  41.  
  42. print(unpack(prize))
  43.  
  44. wait()
  45. debounce = false
  46.  
  47. return (prize)
  48.  
  49. end
  50. end
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59. script.Parent.Humanoid.Died:Connect(function(luckydraw)
  60.  
  61. print("killed a npc")
  62.  
  63. local prizesget = luckydraw()
  64. print(prizesget)
  65.  
  66. get.Value = ("Congrats,you got"..(unpack(luckydraw())))
  67. --print(unpack(prizesget))
  68. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement