Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

onTouched script that unanchors all bricks in a model?

Asked by 8 years ago

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?

0
Try using GetChildren() with a generic for loop. OldPalHappy 1477 — 8y
0
Could you post the code for how that would would work, please? nklajdlkfshjfklds 0 — 8y
0
This isnt a request site, its a learning site. We never just *give* out code. RubenKan 3615 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

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.

0
That definitly wont work. RubenKan 3615 — 8y
Ad

Answer this question