I am making a Zombie Horde game, and the Zombies are controlled by one script, they work pretty well. However when I try to add in new Zombies into the Zombies folder, they aren’t affected by the script and just stand in place.
local function update()
for i,v in pairs(workspace.Zombies:GetChildren()) do
--stuff goes here
end
end
while true do
update()
task.wait()
end
This is basically how I handle it, the Zombies are models that have Humanoids if that helps. But more on my issue, I even tested with making the Heads transparent if they’re afffected, and the Heads don’t turn transparent.
local function update()
for i,v in ipairs(workspace.Zombies:GetChildren()) do
--stuff goes here
end
end
workspace.Zombies.ChildAdded:Connect(function()
update()
end)
task.wait() is a faster version of wait, and I figured out that while I exactly didn’t get a solution, I only now just discovered the ChildAdded function existed, figured out what to do with that.