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

Scripting a part to unanchor any specifically named brick OnTouch?

Asked by 6 years ago

So this seems very simple and this question will definitely conform my noob status, but would it be possible to have a part that causes any brick named a specific name become unanchored in an OnTouch event?

For example, if it fell from the sky, it would cause any part named "Bob" to be set to "Anchored = false "

much thanks!

0
I love you legoseed, but SH rule #1 is that this site is not for requests. You may also seek to elaborate on what you mean more; because I interpreted two separate meanings from your explanation and your example. SummerEquinox 643 — 6y

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago
script.Parent.Touched:Connect(function(Hit)
    if Hit.Name == "Bob" and Hit:IsA("BasePart") then -- Checks name and Class
        Hit.Anchored = false -- Unanchors
    end
end)

Put this script inside the part that you want to unanchor things with.

Another thing I noticed, how is it going to fall from the sky and hit the part if it's already unanchored (it wouldn't fall if it were anchored)??? :P

If this helped, upvote/mark it correct! Thanks!

0
he doesn't have enough rep to upvote it User#23365 30 — 6y
0
I didn't say he had to upvote, I'm saying if anyone stumbles upon this answer in a few months and it helps and *they* have enough rep they can upvote. joritochip 705 — 6y
Ad

Answer this question