Question abot weird randomness in game

link

there is this thing in the game where if you defeat the zombies then the system does not work, i set it up so each player gets a point to keep track of how many have died,

player 2 is the armored zomberts
player 3 is speederts
player 4 is normal zomberts

there should be 10 normal, 4 speed, 3 armored.

is there somthing that i did wrong
(edit: what did i do wrong)

if further clarification is required, i will provide

thanks

  • blobiy

In this part of the code:

It looks like you’re comparing a random number to a chance of that enemy type appearing. As this code is written, the chance of any enemy type spawning is always 10%, because there is always a 10% chance that any random number between 1-10 is going to be whatever is in that variable.

I think what you actually want to do is use the “percent chance” block inside of the math category.

thank you for catching that! although it seems that for some strange reason some of the zombies dont spawn, therefor the “wave” is not, and will never be over, this happens randomly, if you dont do anything (i set the health so you could survive that) everything works, but when you start to kill things it wont spawn a few.

Thanks

  • Blobiy

wait, it works now, kinda weird, guess it was nothing, maybe i was just really really unlucky