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

TextLabel is not a valid member of SurfaceGui?

Asked by 2 years ago
MainItems.CashButton.ScreenPart.SurfaceGui.TextLabel = Values.CashValue.Value
0
Can you elaborate? When does this script run? PaleNoobs 37 — 2y
0
when i start the game in studio SyconicLonic 6 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago
Edited 2 years ago

Hey there! I am guessing that your problem is occurring for one reason: the TextLabel doesn't have enough time to load before this script runs. You can solve this by using WaitForChild()

Try this, and let me know if it solves it:

MainItems.CashButton.ScreenPart.SurfaceGui:WaitForChild("TextLabel") = Values.CashValue.Value
0
Also, if you are trying to set the text, I would change it to TextLabel.Text Amanda314159 291 — 2y
Ad

Answer this question