Dfgjfj

Roulette Handler

Feb 18th, 2025
378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.12 KB | None | 0 0
  1.  
  2. local Players = game:GetService("Players")
  3. local TweenService = game:GetService("TweenService")
  4. local ReplicatedStorage = game:GetService("ReplicatedStorage")
  5. local bot = workspace:WaitForChild("NPC")
  6. local Table = workspace:WaitForChild("Table")
  7. local npcChair = Table:WaitForChild("Chair")
  8. local PlayerChair = Table:WaitForChild("PlayerChair")
  9. local Gun = workspace:WaitForChild("Gun")
  10. local OriginalPosition = Gun.CFrame
  11. local PlayerValue = ReplicatedStorage:WaitForChild("Player")
  12. local Status = ReplicatedStorage:WaitForChild("Status")
  13. local chance = {1,2,3,4,5,6} --// dont mind lol
  14. local Duration = 5
  15. local Choice = {
  16. 90, -- Player
  17. -90 -- npc
  18. }
  19. function MakeTween(Target,Time,Destination,Final)
  20. local a = TweenInfo.new(Time,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0,false)
  21. local b = TweenService:Create(Target,a,{[Destination] = Final})
  22.  
  23. return b
  24.  
  25. end
  26.  
  27. function GetRandomChance()
  28. local Ran = math.random(1,#chance)
  29. return Ran
  30. end
  31. function StartRoulette()
  32. local plr = PlayerValue.Value
  33. local char = plr.Character
  34. local RootPart = char.HumanoidRootPart
  35. MakeTween(Gun,2,"Orientation",Vector3.new(90, -5.003, 0)):Play()
  36. MakeTween(Gun,2,"CFrame",OriginalPosition):Play()
  37. if not char.Humanoid.Sit then
  38. char:MoveTo(PlayerChair.Seat.Position)
  39. end
  40. task.wait(2)
  41. Status.Value = "Spinning.."
  42. local CurrentAngle = Choice[math.random(1,2)]
  43. local info = TweenInfo.new(5,Enum.EasingStyle.Linear,Enum.EasingDirection.In,0,false,0,false)
  44. local FinalResult = 360 * math.random(2,6) + CurrentAngle
  45. local Tween = MakeTween(Gun,5,"Orientation",Vector3.new(0,FinalResult,0))
  46.  
  47. Tween:Play()
  48. local spinsfx = Instance.new("Sound",Gun)
  49. spinsfx.SoundId = "rbxassetid://9113943059"
  50. spinsfx.Volume = 10
  51. spinsfx:Play()
  52. spinsfx.Looped = true
  53. Tween.Completed:Wait()
  54. spinsfx:Destroy()
  55. local Message
  56. local Target
  57. if CurrentAngle == 90 then Message = plr.Name.." is choosed" Target = plr.Character elseif CurrentAngle == -90 then Message = bot.Humanoid.DisplayName.." is choosed" Target = bot end
  58.  
  59.  
  60. Status.Value = Message.." 1/"..#chance.." to die"
  61. task.wait(1.5)
  62. local Tweens = MakeTween(Gun,2,"CFrame",Target.Head.CFrame * CFrame.new(-2,0,0))
  63.  
  64. Tweens:Play()
  65. Tweens.Completed:Wait()
  66. local e = GetRandomChance()
  67. chance[#chance] = nil
  68. if e == 1 then
  69. local sound = Instance.new("Sound",Gun)
  70. sound.SoundId = "rbxassetid://255048411"
  71. sound.Volume = 10
  72. sound:Play()
  73. sound.Ended:Connect(function() sound:Destroy() end)
  74. task.wait(0.5)
  75. Target.Humanoid.Health = 0
  76. if Target.Name == plr.Name then
  77. plr:Kick("You lost")
  78. else
  79. plr:Kick("You won")
  80. end
  81. else
  82. --sound
  83. task.wait(2)
  84. StartRoulette()
  85. end
  86. end
  87.  
  88. StartRoulette()
  89.  
Advertisement
Add Comment
Please, Sign In to add comment