Text is not updating when script is telling it to

So basically I have a Text which should be equal to the same amount of Clicks the player has which is saved in the leaderstats. So when the player joins I want to set the text as the same value. Right now I am sending the ClickNumber which is my text through a remote function to the server and running a playeraddded function so it’ll update when the player joins. My problem is it is not changing the text at all and keeping the text at 0. Script:

	game.Players.PlayerAdded:Connect(function()
		ClickNum.Text = player.leaderstats.Clicks.Value
	end)
1 Like

The text only changes when the player has been added from the script. Use the .Changed function for that value.

1 Like

This makes sense as when you join, the value will be 0 UNTIL the script sets it, so if the client fires the added event first, which it will, it will always be 0. (from my understanding of his script)

EDIT:
You can make it a little more specific by doing:

player.leaderstats.Clicks:GetPropertyChangedSignal("Value"):Connect(function()
    ClickNum.Text = player.leaderstats.Clicks.Value
end)
2 Likes