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

Not Able to change the text on my textlabel? Maybe a Bug?

So this is really simple, I noticed my script was not changing the text on my gui so I decided to do a test. But it just doesn't work, no output or anything.

In a local Script, inside starter Gui

script:

 
local Gui = game.StarterGui.Click.TextLabel

Gui.Text = "test"

2 answers

✓ Accepted answer

Try doing this:

local Player = game.Players.LocalPlayer

local textLabel = game.Players[Player.Name].PlayerGui.Click.TextLabel

textLabel.Text = "test"

To explain what @Soban06 did:

The StarterGui is a folder which gets copied to a player who joins' folder. (When a player joins, he gets a "personal folder" which is game.Players.).

So when your player joins, the content of the StarterGui Folder gets copied into the "personal folder".

So, when you try to change a specified player's gui, you have to change it in the "personal folder" (game.Players..PlayerGui in this case).

Ummm just a small tipp at the end: Keep in mind, that game.Players.LocalPlayer can only be used in a LocalScript.

PS 1: The script you made, changes the text on the textlabel for players who join after the script executed.

PS 2: @Soban06, it would be nice if you can explain your script next time, this site is called "scripting HELPERS" not "script REQUESTS where no one knows what a script even is".

If you got any questions, I'm here ;)

1 comment

0

Thank You !

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