Changing Script Based On Scene

Hi there,
I’m a bit new to this and I was curious at if you could change code based on what scene the player is now in. I’ve finally discovered how to change scenes which is awesome but I wanted to change the amount of coins the player must collect to move on to the next scene.
Thanks so much if you can help,

why don’t you make the coin that player must collect adjustable on the inspector so that you can adjust it yourself?