Dash Depends On Coin Number

Hi everyone!
So i have 2 scripts. One is getting the Number of the coins that the player has collected. The other one is the player movement (where I have my dash() ).
The question is: How can i get the coin(s) number information to the player movement script then decrease it by (1) each time the player used his/her Dash, so if the player has 0 coin(s) he/she can’t dash.

I attached the codes via images.

Thanks for the help <3


Please post your codes using the code tag et not image files.

You just need a reference to your coin script in your player script. You should avoid static variables, in most cases FindObjectOfType will do the job as long as you use it once in a script that wont be spammed on every frame.