Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

[NOT SOLVED] Why doesn't this work?

Everything seems to work, apart from the zombie cloning for Lighting then putting it into the 'Zombies' group in workspace. No errors come up on the console either. Any help would be appreciated.

Lighting = game:service("Lighting")

function waittime()
	wait(10)
end

Lighting.TimeOfDay = "06:00:00"


while true do
	wait()
	waittime()
	
	zombieswork = game.Workspace.Zombies:GetChildren()
	
for i = 1, #zombieswork do
	zombieswork[i]:remove()
	
	waittime()
	
for i = 10, 1, -1  do
	
	zombieslight = game.Lighting.Zombies:GetChildren()
	zombieslight:clone()
	zombieslight.parent = game.Workspace.Zombies
	print('Zombie spawned')

end
end
end

2 comments

0

So what exactly are you trying to do? Are you trying to delete one zombie, then add a whole bunch? What exactly do you want to happen?

0

I'm trying to add zombies into the game from Lighting every 10 seconds, using the for loop, but no zombies spawn in.

1 answer

Try a while true do loop

while true do
--clone script
wait(10)
end

2 comments

0

Did not work.

0

should work now

This discussion is preserved as it was. New answers, comments, and votes are closed.