Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local tweenService = game:GetService("TweenService")
- local wheel = script.Parent
- local proximityPrompt = wheel.ProximityPrompt
- local isSpinning = false
- local reward = {50000, 20000, 100000, 10000, 50000, 20000, 100000, 10000}
- proximityPrompt.Triggered:Connect(function(player)
- if isSpinning then
- return
- end
- print('hej')
- isSpinning = true
- local rewardIndex = math.random(1, #reward)
- local angle = rewardIndex/#reward * 360 - (360 /#reward / 2)
- local offset = -math.random() * 360 / #reward
- local spins = math.random(0, 10) * 360
- angle += offset + spins
- local spinTime = math.random(2,10)
- local tweenInfo = TweenInfo.new(
- spinTime,
- Enum.EasingStyle.Quint,
- Enum.EasingDirection.Out
- )
- -- wheel.Parent.PrimaryPart.CFrame.LookVector
- local tween = tweenService:Create(
- wheel,
- tweenInfo,
- {
- Rotation = Vector3.new(angle, 0, 0)
- }
- )
- tween:Play()
- tween.Completed:Wait()
- player.leaderstats.Diamonds.Value += reward[rewardIndex]
- isSpinning = false
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement