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

How to Unanchor everything that is hit with an explosion?

I am awful at this scripting milaki so don't shout at me if I did it wrong like some people do. Please can I have help on how to do this? So everything and anything that is hit by an explosion gets Unanchored?

Instance.new("Explosion", script.Parent.Parent.Rotor.Rotor) 
Explosion:findFirstChild().Unanchor 
script.Parent.Parent.Rotor.Rotor.Explosion.BlastPressure = 1.79769e+308 
script.Parent.Parent.Rotor.Rotor.Explosion.BlastRadius = 100 
script.Parent.Parent.Rotor.Rotor.Explosion.Position = Vector3.new(-181.343, 65.794, -48.842)
end

1 answer

There is a convenient event of every explosion called hit. This is fired when the explosion hits a Part.

Instance.new("Explosion", script.Parent.Parent.Rotor.Rotor) 

Explosion.Hit:connect(function(part, distance) -- Hit event
	part.Anchored = false -- Unanchor hit part
end)

script.Parent.Parent.Rotor.Rotor.Explosion.BlastPressure = 1.79769e+308 
script.Parent.Parent.Rotor.Rotor.Explosion.BlastRadius = 100 
script.Parent.Parent.Rotor.Rotor.Explosion.Position = Vector3.new(-181.343, 65.794, -48.842)

5 comments

0

This did not work for me, sorry. :(

0

Sorry, my bad! It did!

0

There is no need for the end on line 10 because it is not closing anything!

1

Why not set a variable for the new instance, instead of referencing it the long way from lines 7-9?

0

Haha my bad, I didn't look over the code, just added the unachor part into his script.

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