Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make a Zombie Wave system?

Asked by 5 years ago

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.

0
I'm not sure about the exact way you're making this, but why don't you just save them inside the main script? Wutras 294 — 5y
0
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 mixgingengerina10 223 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

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
Ad
Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

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.

Answer this question