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

How do I make a button cause an explosion somewhere else upon clicking?

Hi, I'm working on a game where you answer questions to see if you're a pro or a noob, and my idea is if you choose pro, you get to do fun stuff to the noobs. If you're a noob, however, you get to try to avoid the pro's attacks.

1 comment

1

Btw, try explaining what your issue/problem is and not what the game is about. :)

1 answer

Consider this:

--//Variables\\--
local clickDetector = script.Parent --//Where the clickDetector is
local part = workspace.Part --//Where the part with the explosion will be

--//Handling\\--
clickDetector.MouseClick:Connect(function()
	--//Create new explosion, don't set parent yet.
	local newExplo = Instance.new("Explosion")
	--//Change the newExplo properties however you want
	newExplo.Position = part.Position --//Thanks to CootKitty for the reminder
	newExplo.Parent = part --//Finally set the parent at the end
end)

1 comment

5

You have to set the position of the Explosion, the position doesn't get set when you parent the explosion.

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