Spin wheel UI
Weighted prize wheel with a smooth spin and server-side pick hook.
- Eight prize segments with weights you set.
- Lands exactly on the chosen prize, with a little random offset.
- Uses ReplicatedStorage.SpinWheel (RemoteFunction) when present so the server decides.
- Prize popup with a claim button.
46 GUI objects · SpinWheelController LocalScript, 90 lines
Preview the SpinWheelController script
local gui = script.Parent
-- Spin wheel UI controller. Free kit from rbxtoolshub.com.
-- For real rewards, let the server pick: create ReplicatedStorage.SpinWheel (a RemoteFunction)
-- that returns the winning index. Without it, the wheel picks locally (preview only).
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local TweenService = game:GetService("TweenService")
local REWARDS = {
{ Label = "100 🪙", Weight = 30 },
{ Label = "💎 x5", Weight = 10 },
{ Label = "500 🪙", Weight = 12 },
{ Label = "🐾 Pet", Weight = 3 },
{ Label = "50 🪙", Weight = 30 },
{ Label = "⚡ Boost", Weight = 8 },
{ Label = "1K 🪙", Weight = 5 },
{ Label = "🎁 Mystery", Weight = 2 },
}
local root = gui:WaitForChild("SpinWheel")
local wheel = root:WaitForChild("Wheel")
local spinButton = root:WaitForChild("Spin")
local result = root:WaitForChild("Result")
local openButton = gui:WaitForChild("OpenSpin")
local closeButton = root:WaitForChild("Close")
local step = 360 / #REWARDS
for index, reward in REWARDS do
local segment = wheel:FindFirstChild("Segment" .. index)
if segment then
segment.Reward.Text = reward.Label
end
end
local function pickLocal()
local total = 0
for _, reward in REWARDS do
total += reward.Weight
end
local roll = math.random() * total
…