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

How would I use a brick as a trigger for another brick?

Asked by 10 years ago

I want to use a trigger brick to cause an explosion in another brick. Thanks

1 answer

Log in to vote
0
Answered by 10 years ago

Are you wanting to be able to click a brick and have another one explode?

If you just want to touch one brick to explode the other you can do the following:

First add in your two bricks and name them differently. For this example I label one "Touch", and another "Explode." Once you have the bricks in your workspace place a script into the Touch brick. In the script write the following:

function onTouched()--Function here
    local Exploding = game.Workspace.Explode--Sets Value

    local boom = Instance.new("Explosion")

        boom.Parent = Exploding

        boom.Position = Exploding.Position--Sets the explosion to the position of our brick

        boom.BlastPressure = 5e+005--Sets Parameter

        boom.BlastRadius = 15--Another Parameter

        boom.Name = "Explosion"--Names the Explosion

end

script.Parent.Touched:connect(onTouched)--Runs the script when the brick is touched

Let me know if you have any other trouble. Hope this helps.

0
just touch it andrewcox1 0 — 10y
0
Thanks andrewcox1 0 — 10y
Ad

Answer this question