Error: Attempt to index string with 'TextTransparency'?

I’ve genuinely been trying to wrap my mind around why this won’t work for a little over an hour now.

script.Parent:WaitForChild("Head"):WaitForChild("PlayerLevel").Level.TextTransparency = 1
script.Parent:WaitForChild("Head"):WaitForChild("PlayerName").Name.TextTransparency = 1

The code above is in StarterCharacterScripts in a LocalScript in case that matters

The first line of code runs just fine. The second line of code gives this error: Attempt to index string with ‘TextTransparency’

I don’t understand why it’s saying that I’m attempting to index string with ‘TextTransparency’ because 1 is a number value not a string.

At first I thought it was printing an error because I was trying to set the TextTransparency before it loaded in. So I added a 10 second wait before it just to see; that didn’t work. I must be overlooking something but I don’t get it.

Additional Information:
PlayerLevel and PlayerName are BillboardGuis located in ReplicatedStorage
image

Then I use a script to clone them from ReplicatedStorage to Player.Character.Head

I’m sure I indexed everything correctly because both BillboardGuis are in the player’s head
image
but yet only PlayerLevel.Level has its TextTransparency set to 1

Sorry for asking for help with such a dumb question :grimacing:

Name is both an attribute of the PlayerName BillboardGui, and a child of it. While you’re intending to index the Gui’s child, it is actually indexing the Name attribute of the Gui, which returns a String.

1 Like

Omg, I can’t believe that I overlooked that, I’m so goofy. Thank you!

1 Like