Last active 1785467647

roblox-local.lua Raw
1local Players = game:GetService("Players")
2local ReplicatedStorage = game:GetService("ReplicatedStorage")
3
4local player = Players.LocalPlayer
5local toggleReady = ReplicatedStorage:WaitForChild("ToggleReady")
6
7local screen = Instance.new("ScreenGui")
8screen.ResetOnSpawn = false
9screen.Parent = player:WaitForChild("PlayerGui")
10
11local button = Instance.new("TextButton")
12button.AnchorPoint = Vector2.new(0.5, 0.5)
13button.Position = UDim2.fromScale(0.5, 0.8)
14button.Size = UDim2.fromOffset(220, 56)
15button.Parent = screen
16
17local function render()
18 local ready = player:GetAttribute("Ready") == true
19 button.Text = ready and "Ready ✓" or "Ready up"
20 button.BackgroundColor3 = ready
21 and Color3.fromRGB(70, 190, 110)
22 or Color3.fromRGB(70, 90, 120)
23end
24
25button.MouseButton1Click:Connect(function()
26 toggleReady:FireServer()
27end)
28
29player:GetAttributeChangedSignal("Ready"):Connect(render)
30render()