TextLabel's text value isn't updating

Hello, sorry to bug you with a simple issue I have, but as the title says, whenever I try to change the Text of a TextLabel, it does not update the value nor show it on the client.

I have searched the devforum but I have found nothing that answers my question

Here is the script:

local textlabel = script.Parent

game.Players.PlayerAdded:Connect(function(player)
	player.CharacterAdded:Connect(function()
		textlabel.Text = "test"
	end)
end)

And here is my explorer:
image

Sorry again if the error is right infront of my eyes
Every reply is appreciated!

Oh and also there’s nothing in the output nor script analysis
If you need more information I’ll try my best to give you it

This is because the player and character are being loaded before the startergui clones the UIs and puts them into the playergui for them to run, your character is basically loading faster.

1 Like

You don’t have to use playeradded function to change the value of the text, you can just change it in a simple and direct way and it would work. This is because the code wouldn’t run until the UI and its descendants(including the script) are parented to the playergui. If you need a further explanation on this, let me know. Also you can tell me what you are trying to achieve, maybe I can then be more helpful.

1 Like

Oh thanks, I removed the PlayerAdded function and CharacterAdded function completely and now it works like hotcakes. I thought you needed to put PlayerAdded there so the gui can load but I guess it was preventing the gui from loading haha

Here is the updated script if anyone wants it:

local textlabel = script.Parent

textlabel.Text = "test"
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.