Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why won't my text change?

Asked by 8 years ago
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... :(

0
Is the gui visible? alibix123 175 — 8y
0
Is the gui visible? alibix123 175 — 8y
0
yes thehybrid576 294 — 8y
0
before the if, do a print(gui.Visible) theCJarmy7 1293 — 8y
View all comments (3 more)
0
That's strange because I tried replicating your script and it worked fine. Is it a localscript or a regular script? alibix123 175 — 8y
0
regular, as it says in the desc. thehybrid576 294 — 8y
0
ok i fixed it, I added a while true do loop, and it worked?? :P oh well thehybrid576 294 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

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

Ad

Answer this question