Point System /w Overhead Gui not working

I’ve been working on a point system with an overhead gui for one of my games but it doesn’t seem to work.

Whenever I die or the point changes, the Gui text wont change as well. The Gui Color will also be the same every time.
image
image

It doesnt seem to display any errors and I tried setting the score value through the server, but it doesnt seem to work.

Here is what you should do. Move the Player Added script into SSS, but get rid of the score.Changed function.

Create a new local script inside the Overhead ui you want. then you can do:

game.Players.LocalPlayer.Score.Changed:Connect(function()
      ["Referencelabelhere"].Text  =. tostring(score.Value)
end)

Two things here. One thing is moving it to a local script, which is what you should use for UI related stuff

Secondly, label.Text is a string value, therefore if you want to set a score, (Which i presume is a number or int value,) You must set your number to a string using the tostring() function.

What do you mean by creating a local script in the Overhead ui?

Insert a new local script inside your GUI

But the Gui is being created through the script?

Oh. Sorry about that. Then just try the tostring() function first, and I’ll think of something else

I suggest doing this. Create a base template for the gui instead of creating it in a script. You can just clone it and change the colour through the function.

Alright, Ill try that and see how that goes

then put the local script inside the gui like I said.

A bit of a misconception is how people think that UI strictly need to be changed on the client. But that’s just not true. You’d wanna use the client to handle inputs, but simply changing the text of a UI doesn’t need to be done in the client.

@OP, try to debug by placing print statements where needed, such as when an event happens, or inside a if statement’s code.

I’d also recommend you to use the following module in order to prevent issues when Players.PlayerAdded is listened to too late.

So I should make the text color, and Text update in the local script?

I didn’t say that it has to be strictly handled on the client, I just said I suggest doing it on the client, since it is technically the “right way” to do it, and you can also access values from the player.

Good point, though

So I tried your method, not sure if I did something wrong but when the score changes the gui text to the score value, but when I die it resets back to 0.

image
Local Script

Figured out what I did wrong, Thanks for the help!

Found a problem, when the OverheadGui updates, it updates for every player after they die and everyone will have the same amount of points.