You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
I want my script to respond to a boolvalue when it becomes true -
What is the issue? Include screenshots / videos if possible!
It does not respond -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
The devforum did not give me solutions
Here is the script, it is a server script inside of a model.
local zombieSpawner = script.Parent
local roundInProgress = game.ReplicatedStorage.Values.RoundInProgress
local playingTeams = game.Teams.Playing
while zombieSpawner.Parent.Parent == workspace and roundInProgress.Value == true do
print(roundInProgress.Value)
local zombie = game:GetService("ServerStorage")[" "]:Clone()
zombie.HumanoidRootPart.Position = zombieSpawner.Containment.Position + Vector3.new(0, 0, -5)
zombie.Parent = game:GetService("Workspace")
local spawnCooldown = 7
local playerCount = #playingTeams:GetChildren() - 1
local currentCooldown
if spawnCooldown - playerCount <= 3 then
currentCooldown = 3
else
currentCooldown = spawnCooldown - playerCount
end
wait(currentCooldown) -- Change how much time between each zombie spawn
end
When (roundInProgress == true) was removed from the script, the script printed roundInProgress as true so it acknowledged roundInProgress as true, but it does not start the loop even when roundInProgress becomes true.