I want,that a model with some parts inside,Anchor and unanchor for ever,im using that script
function check(model) for i, part in pairs(model:GetChildren()) do if part.ClassName == "Model" then while true do check(part) elseif part.ClassName == "Part" then part.Anchored = true wait (4) part.Anchored = false end end end check(script.Parent)
Hi Spring,
check(script.Parent)
Here, I polished it a bit and placed the while loop correctly. This is how it should be:local function anchor_unanchor_forever(model) for _, part in next, model:GetChildren() do if part.ClassName == "Model" then anchor_unanchor_forever(part); elseif part.ClassName == "Part" then part.Anchored = true; print(part.Anchored) wait(4) part.Anchored = false; print(part.Anchored) end end end while wait() do anchor_unanchor_forever(script.Parent); end
Thanks,
Best regards,
~~ KingLoneCat