Problem with increasing rate of prefab instantiation

I’m trying to make a game in unity in which you have to dodge rocks falling from above you. I have copied the code i have used below but the problems i am facing are that the if condition-
if(ScoreScript.currentScore%10==0) is behaving weirdly. Like the value of spawnRate will decrease as long as mod 10 is done, as soon as i change it to 100, the modulus doesnt work and sometimes spawnRate will decrease at currentScore value at 30 or 40 instead of at 20.

#pragma strict

var spawnPosition : Vector3;
var Boulder : GameObject;
var spawnRate : float = 0.5;
var nextSpawn : float = 1;
var count : float;

function Start () {

function Update () {
	count = ScoreScript.currentScore%100;
	if(Time.time > nextSpawn){
		nextSpawn = Time.time + spawnRate;
			spawnRate-= 0.1;

function Spawn(){
	spawnPosition = new Vector3(
	Instantiate(Boulder, spawnPosition,Quaternion.identity);


may be your current score is declared as float and ScoreScript.currentScore%10==0 may not be returning true. please Debug the value of ScoreScript.currentScore%10 and check if it is the reason.