Hello, im working in a balancing system for my game, so there are 2 humans lefts and 3 zombies.
How do you get infected?
My infect system is based on stepping on a infected puddle, and so this will make you a zombie
Whats the problem?
What if everyone steps in the puddle, everyone gets infected and the game isn't fun with everyone a zombie, so we need to balance the teams?!
What did u tried?
I tried many things to solve this, first of all my game has a zombie count, everytime someone becomes a zombie it counts
So with this counter i made some of my tries to solve it (None of them worked)
if workspace.ZombieCount.Value >= #game.Players:GetPlayers() then Module.Transform(Hit.Parent) end
if #game.Players:GetPlayers() > workspace.ZombieCount.Value then Module.Transform(Hit.Parent) end
What these few lines do
if workspace.ZombieCount.Value >= #game.Players:GetPlayers() then Module.Transform(Hit.Parent) end
Is check if the amount of zombies in the workspace is higher or equal to the amount of players. If it is higher or equal to the amount of players, it transforms the player to a zombie.
What it should rather be is:
local Players = game:GetServicer("Players") local zombieCount = workspace.ZombieCount.Value if zombieCount.Value < #(Players:GetPlayers()) then -- Increase the value of the zombieCount right away before transforming the player to a zombie. zombieCount.Value = zombieCount.Value +1 Module.Transform(Hit.Parent) end
So this way, if the amount of zombies in the workspace is less than the amount of players, it transforms the zombie to a player.