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.
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.