I am making a zombie wave survival, but I am not sure how to store wave data. Should I use a ModuleScript where I keep all the data or should I make ValueObjects and keep it in some folder? Every wave has 2 variables, one is how many zombies should be spawned and the other is bool for Boss spawning.
COMMUNITY QUESTION
How to make a Zombie Wave system?
2 answers
You can use an int value inside of the main script
local AOZA = Instance.new("IntValue") --AOZA is amount of zombies alive
AOZA.Parent = script
AOZA.Name = "AOZA"
--Check if all of the zombies are dead
if AOZA.Value == 0 then
--Spawn Zombies
end
and in the other script inside of the zombie:
local AOZA = --Location of the script .AOZA
if script.Parent.Humanoid.Health == 0 then
AOZA.Value = AOZA.Value - 1
end
I am trying to make like a list of waves, because every wave is different. In C#, I would just make a wave class and store a list of them in some script, but in Lua im not sure how to keep levels or other data, so that the other scripts would have access to that data.
This discussion is preserved as it was. New answers, comments, and votes are closed.

2 comments
I'm not sure about the exact way you're making this, but why don't you just save them inside the main script?
You can use Global Vars for this, for an example, if the Zombie's humanoid is 0 then it decreases the amount of zombies alive, and in the main script you check if the amount of zombies alive are 0 then you spawn the next wave. Here I will write an example