Random Rolling Enemy Spawner

I am making a ‘Random Rolling Enemy Spawner’. The problem is, nothing is even spawning, When I press summon nothing spawns, I am a beginner scripter so I don’t have much experience. Currently I don’t think the function is even getting fired, as the “A Normal Zombie has Appeared” Does not even get set in the output. If you can help that would be great. The script is in ‘ServerScriptService’ I have 2 module scripts inside the ‘RollingServer’ script here is the script

What does the ChanceList module have? The next thing to check is if the function is even being called at all from the invoke:
Right before the for loop, add a print indicating “Loop starting” and if that shows then that gives a big hint as to where the problem is. If it isn’t, expand the replicated storage and make sure that the function you put there is where you expect it to be.

This is what is inside the chance list

When I press roll here is what comes up when I put in “Loop Starting” in the loop.


The print(“A Normal Zombie has Spawned”) on line 9 does not come up so it may have something do to with the rolling system, even when I roll on a normal zombie

OK then I’d need to see what the selectChance module script is doing. I can only assume it’s due to the rolling system as well.

Here is the select chance script

OK, under the spawner code in the loop, print the roll result. That’s the last thing I can think of being the problem.

Like this?


Oh the print is not coming up, just the print(“Loop Starting”) showed up.

No, add the following:
print(rollResult) after the roll result.

I think this is right


Nothing comes up in the output. except the print(loop)

The result table is being nil or {}?

EDIT: On top of that, it looks like you’re using two different returns. May I ask why you’re trying to set up the spawner code like this?

the result table is {} but I think I can change some things

The result table being {} means that whatever is being returned is nil. So either the function you’re using is bad or you aren’t using the return correctly.

#help-and-feedback:scripting-support

also, do you mind turning your image’s code into a codeblock so it’s easier to read?

1 Like

How do I turn the code into a codeblock?

Use three backticks at the start and end of your code. ```

1 Like