I need help making a score system for a First Person Controller

Title says it, mostly. I need this to make an exploration game with a real goal. And all solutions I have tried don’t work. I want to be able to display the score, and have a script that allows the FirstPersonController to collide with a collectible and make it improve the score. Thank you for your time. I would like javascript, but C# would work.

What have you tried? Create a score class with an int and a reference to a UI text object. Give it a public function that updates the score integer and updates the text to display it. Then call that function from your collectables when they collide with the player.