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

onTouched script that unanchors all bricks in a model?

Let's say I'm making an unstable old wooden bridge or something. When the player steps onto the bridge model, I want all of the bricks in it to unanchor and make it fall apart. I'm a total noob to scripting and have no idea how to do this. Can anyone help?

3 comments

0

Try using GetChildren() with a generic for loop.

0

Could you post the code for how that would would work, please?

0

This isnt a request site, its a learning site. We never just give out code.

1 answer

game.Workspace.Model:GetChildren().Touched:connect(function() for i,v in pairs(game.Workspace.Model:GetChildren()) do v.Anchored = false end end)

This might work.

1 comment

0

That definitly wont work.

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