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

How can I make a brick unweld other bricks when it passes through the welded bricks?

So I want to make a brick that is moving with velocity and when it comes into contact with parts of a building that are unanchored but welded, these parts will then unweld and the building will fall apart.

So far my script looks like this

function onTouched(hit)
hit:BreakJoints()
end

connection = script.Parent.Touched:connect(onTouched)

This does not currently work and I'm a bit stuck on what to do.

2 answers

How about using an explosion - you can add this effect to the part that hits, and adjust the amount of force etc.

local E = Instance.new("Explosion")
E.BlastRadius = 10 -- 10 studs around will be affected
E.BlastPressure = 500000  -- adjust to knock down your wall
E.DestroyJoinRadiusPercent = 5 -- you can adjust this also - defaults to 1
E.Parent = Part -- you can parent it to the part or the hit

I'll try that.

Upon further testing I found out the script I originally posted worked, but thanks for answering as well, I'll make sure to keep it in mind.

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