Advertisement
drakon-firestone

Untitled

Jan 7th, 2024
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. local tweenService = game:GetService("TweenService")
  2.  
  3. local wheel = script.Parent
  4. local proximityPrompt = wheel.ProximityPrompt
  5. local isSpinning = false
  6.  
  7. local reward = {50000, 20000, 100000, 10000, 50000, 20000, 100000, 10000}
  8.  
  9. proximityPrompt.Triggered:Connect(function(player)
  10.  
  11. if isSpinning then
  12. return
  13. end
  14. print('hej')
  15.  
  16. isSpinning = true
  17.  
  18. local rewardIndex = math.random(1, #reward)
  19.  
  20. local angle = rewardIndex/#reward * 360 - (360 /#reward / 2)
  21. local offset = -math.random() * 360 / #reward
  22. local spins = math.random(0, 10) * 360
  23. angle += offset + spins
  24.  
  25. local spinTime = math.random(2,10)
  26.  
  27. local tweenInfo = TweenInfo.new(
  28. spinTime,
  29. Enum.EasingStyle.Quint,
  30. Enum.EasingDirection.Out
  31. )
  32. -- wheel.Parent.PrimaryPart.CFrame.LookVector
  33. local tween = tweenService:Create(
  34. wheel,
  35. tweenInfo,
  36. {
  37. Rotation = Vector3.new(angle, 0, 0)
  38. }
  39. )
  40.  
  41. tween:Play()
  42.  
  43. tween.Completed:Wait()
  44.  
  45. player.leaderstats.Diamonds.Value += reward[rewardIndex]
  46.  
  47. isSpinning = false
  48. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement