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

Why won't my text change?

serverstorage = game:GetService("ServerStorage")
gui = game.Workspace.Invis.SurfaceGui.TextLabel

if gui.Visible == true then
	print("a")
	gui.Text = "a game by uwot_m9"
end

This is a script in the workspace, and the "gui" is a SurfaceGui.TextLabel

i get no errors...?

And also it doesn't print... :(

7 comments

0

Is the gui visible?

0

Is the gui visible?

0

yes

0

before the if, do a print(gui.Visible)

0

That's strange because I tried replicating your script and it worked fine. Is it a localscript or a regular script?

0

regular, as it says in the desc.

0

ok i fixed it, I added a while true do loop, and it worked?? :P oh well

1 answer

you have to set the gui visible on the client... try cycling through each player and finding the gui in their playergui, then update it there. I've added some helpful code below.

for i, player in ipairs(game.Players:GetChildren()) do
if player.PlayerGui then
player.PlayerGui.GUI_NAME_HERE.Text = "text here!"
end
end

Note: Use this for loop to set each player's gui to visible if needed

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