This is my script in ServerScriptService
:
local ReplicatedStorage = game:GetService("ReplicatedStorage") local MainPlate = game.Workspace:WaitForChild("MinePlate") local Status = Instance.new("BoolValue") local RoundLength = 50 local Intermissionlength = 5 local InRound = game.ReplicatedStorage:WaitForChild("inround") local status = game.ServerScriptService:WaitForChild("Status") local function timer() while true do for i = Intermissionlength, 1, -1 do InRound.value = false wait(1) local startintro = Instance.new("BoolValue") status.value = "Intermission: "..i.." seconds" end for i = RoundLength, 1, -1 do status.value = true wait(1) local startintro = Instance.new("BoolValue") status.value = "Game: "..i.." seconds left!" end end end spawn(timer)
In ReplicatedStorage
:
-Inround (BoolValue)
-Status (BoolValue)
In my LocalScript under StarterGui
:
local status = game.ReplicatedStorage.Status local player = game.Players.LocalPlayer local gui = player:WaitForChild("PlayerGui") local title = gui.Timer.Title function UpdateTitle() title.Text = status.value -- Error end UpdateTitle() status.Changed:Connect(UpdateTitle)
In StarterGui
:
-Timer
-localscript
-Title