For my zombie game i need to make different types of zombies so the game does not get too easy. Also if its possible, config how rare the zombies are. Here is the script : ~~~~~~~~~~~~~~~~~
local CS = game:getService("CollectionService")
while true do
wait(5)
for i, v in pairs(CS:GetTagged("spawner")) do
if game.ReplicatedStorage.Values.gameInProgress.Value == true then
if game.ReplicatedStorage.Values.zombiesRemaining.Value > 0 then
local NPC = game.ReplicatedStorage.Zombie:Clone()
NPC.Parent = v
NPC.HumanoidRootPart.CFrame = v.CFrame
CS:AddTag(NPC, "Zombie")
game.ReplicatedStorage.Values.zombiesRemaining.Value = game.ReplicatedStorage.Values.zombiesRemaining.Value - 1
end
end
end
end
What i want is different types of zombies spawning using math.random() also when replying how to do it i need the position.
EDIT: If there are any other ways i can do the other types of zombies and its shorter, ill accept.

1 comment
Put all the zombies in a list, then do zs[math.random(#zs)].