Hey there, I’m trying to make a button that makes a model anchored when clicked with a bool value called “DummyIsNPC” in a folder called Container but it doesn’t work, can someone help?
![]()
script:
function clicked()
game.Workspace.Container:FindFirstChild("CanCleanup")
for i,v in pairs(workspace:GetChildren()) do
if v.Name == "Container" then
for s,q in pairs(v:GetChildren()) do
q:FindFirstChild("CanCleanup")
if q.CanCleanup.Value == true then
q.Anchored = true
end
end
end
end
end
script.Parent.MouseButton1Click:connect(clicked)