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

why i cant change the text from a GUI?

Asked by
Gigaset39 111
2 years ago

(experience level= 0)

hello, i use

         local hint = game.StarterGui.ScreenGui.TextLabel

          hint.Text = "Let Play"

But it doeset work... it did work for like.. 2 times, but now it doesent work do i need to change a setting in TextLabel? also, the script from before its in workspace.

before, i used a Board that was in workspace and it work, but now i want the text to be on screen,i tryed 2 YT videos, but i cant figure it out.

0
Is the Script a LocalScript or a Normal Script MattVSNNL 620 — 2y

2 answers

Log in to vote
0
Answered by 2 years ago

Your trying to edit StarterGui, StarterGui is just what gets copied to PlayerGui when a player joins or respawns.

You need to change game.StarterGui to:

game.Players["PlayerName"].PlayerGui.ScreenGui.TextLabel

if this is a local script and your only changing the current player you can use:

game.Players.LocalPlayer.PlayerGui.ScreenGui.TextLabel

0
Thanks, this is a normal script, not a local script, btw, how i make it work whit all the players on the game? Gigaset39 111 — 2y
0
li tryed: Local hint = game:GetService("Players").PlayerGui.ScreenGui.TextLabel Gigaset39 111 — 2y
0
Also, when my character dies, i no more see the text, but when the script restarts it works. Gigaset39 111 — 2y
0
If you want to continue to see the text, In the ScreenGui Instance when not play testing, set ResetOnSpawn to false Protogen_Dev 268 — 2y
Ad
Log in to vote
0
Answered by
enes223 327 Moderation Voter
2 years ago

hey you! have you ever heard of enes? if you are in trouble, better call enes!

Answer this question