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

How do I make a brick fall when touched by a specific brick or touched by an explosion?

I'm struggling (since I'm not very good at scripting) to make a brick fall when it is hit by an explosion or touched by a specific brick.

I already have the script I need to make the brick become in-anchored when in contact with another brick, but I'm trying to make a script so that if it is hit by an explosion then it will also become in-anchored. Kind of like a 2 way situation, if it is touched by a specific brick then it will fall, or if it is hit by an explosion, before it touches the specific brick, then it will also fall.

local part = script.Parent
part.Touched:connect(function(hit)
    if (hit.Name == "Meteor") then
        part.Anchored = false
    end
end)

1 answer

✓ Accepted answer

You're going to need to be able to obtain the Explosion instance to do this.

Explosion = Workspace.Explosion --???

function ExplosionHit(part)
	if part.Name == "The part you want unanchored's name" then -- you can also use just the objectvalue of the part
		part.Anchored = false
	end
end

Explosion.Hit:connect(ExplosionHit)

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