Zombie spawn system can someone make it smaller? tried my best https://pastebin.com/QtzwmCzg
COMMUNITY QUESTION
Zombie spawn system can someone make it smaller? tried my best
1 answer
This is why tables are very efficient. as you can just make up a key and a value. For example:
local zombies = {--Continue this array
[1] = "ArmyZombies"
}
Zombies [zombies[ChooseRandomZombie]]:Clone().Parent = worldspace.AliveZombies
This way you only need to have a table and let the ChooseRandomZombie index the table. So no need for a bunch of if statements. It'll directly access the array making so you can have the long list of zombie types and then the value indexes it. I'd explain more if needed because I typed this out on mobile.
This discussion is preserved as it was. New answers, comments, and votes are closed.
