This means that for every frame in which the health taker is less than 200 quants from the player, it will subract 2*time_step from player_health.

To limit the amount you would need to add a limit, and a cool down period.
So inside of "health_taker" you could initialize two variables:
Code
var target_health = 0; 
var cool_down = 0;


So, when the player gets too close, first you will assign target_health like this:

Code
if(cool_down == 0)
{
cool_down = 10;
target_health = player_health - 10;
}


Then you can say:
Code
if(player_health > target_health)
{
player_health -= 2 * time_step;
}
else
{
player_health = target_health;//so it does not go below the target health
}


Finally, add the timer script after all this, but before the wait(1);
Code
if(cool_down > 0)
{
cool_down -= .5 * time_step;//play with this number ... .5 might be too fast or too slow
}
else
{
cool_down = 0;//now it's ready to do damage again
}


Last edited by Dooley; 06/08/21 00:09.