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

How do you make a brick disappear with an explosion?

Asked by 9 years ago

Is this possible at all, if not can an explosion make certain bricks (not all that are around it) turn collisions off making it fall through a baseplate? Thanks!

0
Yes, it is possible. 1waffle1 2908 — 9y

2 answers

Log in to vote
-1
Answered by
yoshi8080 445 Moderation Voter
9 years ago

I fixed it, It should work... You need the bricks to be anchored, and not welded to any other parts. and put this script in a part. It can only work once so yea...

function OnTouch(hit)

local brick = game.workspace:FindFirstChild("Brick1")
local brick2 = game.workspace:FindFirstChild("Brick2")
local brick3 = game.workspace:FindFirstChild("Brick3")
local brick4 = game.workspace:FindFirstChild("Brick4")
local human = hit.Parent:FindFirstChild("Humanoid") -- returns "Humanoid" if exists, else returns nil
if human ~= nil then     -- if the toucher is human, then
local boom = Instance.new ("Explosion", game.workspace.Brick1)
boom.Position = brick.Position
boom.BlastPressure = 10
boom.BlastRadius = 1
brick.Anchored = false
brick.CanCollide = false
brick.Transparency = 1
brick2.Anchored = false
brick2.CanCollide = false
brick2.Transparency = 1
brick3.Anchored = false
brick3.CanCollide = false
brick3.Transparency = 1
brick4.Anchored = false
brick4.CanCollide = false
brick4.Transparency = 1
wait(1)
end
end
script.Parent.Touched:connect(OnTouch)
Ad
Log in to vote
-1
Answered by 9 years ago

Didn't work. Thank you for the response though! :)

Answer this question