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

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

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

1 answer

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.

2 comments

0

just touch it

0

Thanks

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