orders = {"I wanna have a bloxycola plz","I wanna have doritos","I wanna have a bowling shoes plz"}
while true do
if script.Parent.YesNo.Value == false then
script.Parent.YesNo.Value = true
human = game.Lighting.People:GetChildren()
humanclone = math.random(1, #human)
humanclone = human[humanclone]
h = math.random(1, #orders)
humanclone.Say.Value = orders[h]
clonehuman = humanclone:Clone()
clonehuman.Parent = game.Workspace
clonehuman:MoveTo(script.Parent.Position)
wait(5)
end
end
I am having a problem with it, It should do loop but when it start it should stop generating characters but the problem is when I active it, it start to crash and spawn the character but no more code was loaded can somebody look at it? note it says warning in line 2 but I dont notice the error

4 comments
If you want it to stop generating the characters, use break . I'm not sure why it's lagging too, maybe add wait(5) below while true do ?
You might have to place the wait directly behind the 'while true do'. This is so the loop doesn't start before necessary components of the script load.
ok I will try
It worked thanks