Hello! I need help with my wheel spin table. Basically I need to make a weight table for the wheel but do not know how to do it. First person to give me a correct answer will receive 50 robux
Module Script:
local rewards = {
1,
2,
3,
4,
5,
6,
7,
8
}
return rewards
Script inside Starter GUI
local REWARD_DEGREE = 45
local wheel = script.Parent.WheelBackground.WheelPart
local spin = script.Parent.WheelBackground.Buttons["Spin!"]
local rewardsModule = require(game:GetService("ReplicatedStorage").SpinnerRewards)
local fullSpins = 4
local TweenService = game:GetService("TweenService")
local Weight = 0
spin.MouseButton1Down:Connect(function()
local buttonDebounce = false
local randomRewardIndex = rewardsModule[math.random(1, #rewardsModule)]
local targetRotationAngle = (randomRewardIndex-1) * REWARD_DEGREE
local endRotation = -((360 * -fullSpins) + (REWARD_DEGREE) * (randomRewardIndex - 1))
local tween = TweenService:Create(wheel, TweenInfo.new(3, Enum.EasingStyle.Quad, Enum.EasingDirection.Out), {Rotation = endRotation})
if buttonDebounce == false then
buttonDebounce = true
wheel.Rotation = 0
local SpinSound = script["Random/Wheel Spin"]
SpinSound:Play()
tween:Play()
wait(3)
buttonDebounce = false
print(rewardsModule[randomRewardIndex])
end
end)