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.
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.
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.
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.
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.