I’m making a wave system for a Tower Defense game, and I have decided to create the waves in a form of a table.
module.Waves = {
{enemies.Basic, 1, enemies.Basic, 1, enemies.Basic, 1, enemies.Basic}
}
function module.RunWaves()
local wave = 1
for i, v in pairs(module.Waves) do
local currentWave = v
local currentEnemy = currentWave[i]
-- This is where I am stuck, the number is meant to be the wait time between spawns, and the Instance is the enemy, I want to identify which is which.
end
end
I don’t know how to detect if currentEnemy
is a number or an instance, I would like to do this because in the system that I am creating, the Instance is the enemy being created, and the number is the wait time between spawns.
Any help is appreciated. Many Thanks.