Strange behaviour of the game mobs

Hello! All, so, the game I’m working on it has some “problems” with the mobs, It’s currently not released. It’s on a test place.
It’s a tds game, I’ve encountered a problem with spawning mobs (in the 2nd wave).

THE PROBLEM: On the 2nd wave, the mobs spawn twice as intendend and do not respect the task.wait() I added. This problem wasn’t happening when I made the wave system and spawn system, I “met” it just now, when I’m making the tower system, still I can’t find anything that breaks the code or anything that resolves this.

SCREENSHOT OF THE PROBLEM:

Sorry if it has a bad quality, but you can see that on the 2nd wave the enemies are spawning twice, instead on the first only once.

All help is appreciated! :smiley:

1 Like

I can share some parts of my code if there’s a need to it!

1 Like

Could you please share the script which spawns them, Ctrl V the entire script

1 Like

Sure, I use oop alot, so I will share some of my modules.

2 Likes

So you were saying that the 2nd wave is 2X bigger than the 1st wave does it continue doubling after that?

2 Likes

I setted the indexes only up to the 2nd wave, as you can see in the index module.

1 Like

The [n] is the number of the wave the strings in the table, like: {“a=1”,“b=2”} are just the enemies that are going to spawn a is the name and 1 is the times that it has to spawn, same for the b or just the name of the mob.

That’s all for the main scripts, @TheMightyThor2008 I hope this was the info needed!

1 Like

If someone could replay and help me on this topic, because I have to get this fixed! Thanks for listening!

1 Like

Yeah, I think you are right, this wasn’t happening before, tho @TheMightyThor2008 !

1 Like

Figured out, it was the timing, I just had to change the wave duration to 60! Thanks for your help, @TheMightyThor2008 !

3 Likes

Happy you managed, it was too difficult for me to solve :sweat_smile:

1 Like

Haha, thanks anyway, @TheMightyThor2008 :smile:

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.