Hey, I was following a Youtube video for a rounds system (30 seconds roumd, then 10 second intermission, etc.), and the round system works, but the text from one script to the other doesn’t. The text doesn’t work in the localscript, not forwarding it to the GUI.
Here are the scripts:
Rounds Script (Script)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Players = game:GetService("Players")
--VAIRABLES
local requiredPlayers = 1
local roundLength = 10
local intermissionLength = 15
local statusText = ""
local statusUpdate = ReplicatedStorage:WaitForChild("StatusQuo")
local function waitForPlayers()
print("Line 13")
statusText = "The game will start soon!"
repeat
print("Line 17")
task.wait(1)
statusUpdate:FireAllClients(statusText)
until #Players:GetPlayers() >= requiredPlayers
end
local function startRound()
print("RoundBegun")
end
local function endRound()
print("RoundEnded")
end
while true do
--INTERMISSION
for i = intermissionLength, 0, -1 do
statusText = "Game in Progress.. (" ..tostring(i)..")"
statusUpdate:FireAllClients(statusText)
task.wait(1)
end
waitForPlayers()
startRound()
--GAMEROUND
for i = roundLength, 0, -1 do
statusText = "Game In Progress v.2 ("..tostring(i)..")"
task.wait(1)
end
endRound()
end
LocalScript in GUI:
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local statusText = script.Parent:WaitForChild("StatusText")
ReplicatedStorage:WaitForChild("Statustext").OnClientEvent:Connect(function(text)
text.Text = statusText
end)
Output when fired:
Explorer:
I also don’t exactly know where to go for the infinite yield fix so if anyone knows that, that would be great! Thanks.