Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Does not change the text in the game. What is the problem?

When this game.StarterGui.ScreenGui.TimerTime.Value script is executed, its value changes every second (as it should be), game.StarterGui.ScreenGui.Frame.ManyPlayers.Text also changes, but it constantly writes one number on the game screen.

while game.StarterGui.ScreenGui.GameStarted.Value == true do
	game.StarterGui.ScreenGui.Frame.TextLabel.Text = "WAIT"
	game.StarterGui.ScreenGui.Frame.ManyPlayers.Text = "00:" .. game.StarterGui.ScreenGui.TimerTime.Value
	wait(1)
	game.StarterGui.ScreenGui.TimerTime.Value = game.StarterGui.ScreenGui.TimerTime.Value - 1
end

1 comment

0

You need to access the players gui not the starter gui

1 answer

✓ Accepted answer

StarterGui is a Replication Service, these changes won't be made because the actual GUIs were Cloned into a folder called PlayerGui, once this is done, they will not cross over again, therefore no updates or new GUIs created will be seen. This belongs to the Local Client, so you must use this Service as reference instead: (Side note: You should use variables as you call the same lines more than once, it also cleans up your code!)

--// LocalScript

local Player = game:GetService("Players").LocalPlayer
local PlayerGui = Player:WaitForChild("PlayerGui")
local ScreenGui = PlayerGui:WaitForChild("ScreenGui")

while ScreenGui.GameStarted.Value == true do
    ScreenGui.Frame.TextLabel.Text = "WAIT"
    ScreenGui.Frame.ManyPlayers.Text = "00:" .. ScreenGui.TimerTime.Value
    wait(1)
    ScreenGui.TimerTime.Value = (ScreenGui.TimerTime.Value - 1)
end

Hope this helps! Don't forget to accept this anser if so!

This discussion is preserved as it was. New answers, comments, and votes are closed.