Bluefield revised this gist . Go to revision
1 file changed, 30 insertions
roblox-local.lua(file created)
| @@ -0,0 +1,30 @@ | |||
| 1 | + | local Players = game:GetService("Players") | |
| 2 | + | local ReplicatedStorage = game:GetService("ReplicatedStorage") | |
| 3 | + | ||
| 4 | + | local player = Players.LocalPlayer | |
| 5 | + | local toggleReady = ReplicatedStorage:WaitForChild("ToggleReady") | |
| 6 | + | ||
| 7 | + | local screen = Instance.new("ScreenGui") | |
| 8 | + | screen.ResetOnSpawn = false | |
| 9 | + | screen.Parent = player:WaitForChild("PlayerGui") | |
| 10 | + | ||
| 11 | + | local button = Instance.new("TextButton") | |
| 12 | + | button.AnchorPoint = Vector2.new(0.5, 0.5) | |
| 13 | + | button.Position = UDim2.fromScale(0.5, 0.8) | |
| 14 | + | button.Size = UDim2.fromOffset(220, 56) | |
| 15 | + | button.Parent = screen | |
| 16 | + | ||
| 17 | + | local 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) | |
| 23 | + | end | |
| 24 | + | ||
| 25 | + | button.MouseButton1Click:Connect(function() | |
| 26 | + | toggleReady:FireServer() | |
| 27 | + | end) | |
| 28 | + | ||
| 29 | + | player:GetAttributeChangedSignal("Ready"):Connect(render) | |
| 30 | + | render() | |
Newer
Older