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

TextLabel is not a valid member of SurfaceGui?

MainItems.CashButton.ScreenPart.SurfaceGui.TextLabel = Values.CashValue.Value

2 comments

0

Can you elaborate? When does this script run?

0

when i start the game in studio

1 answer

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

1 comment

0

Also, if you are trying to set the text, I would change it to TextLabel.Text

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