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 an explosion when clicked?

how do i make an explosion when a part is clicked?

2 answers

local ClickDetector = Workspace.Part.Clickdetector
ClickDetector.MouseButton1Click:Connect(function()
	local Boom = Instance.new("Explosion")
	Boom.Position = Workspace.Part.Position
	Boom.Parent = Workspace
end)

2 comments

0

my man it's not a gui button

0

bro its click detector

ClickDetector.MouseClick:Connect(function(playerWhoClicked)
	local characterWhoClicked = playerWhoClicked.Character or playerWhoClicked.CharacterAdded:Wait()
	
	local Explosion = Instance.new("Explosion", workspace)
	Explosion.Position = characterWhoClicked:GetPivot().Position -- explodes the player
end)

2 comments

0

i just want it it explode not explode the player

0

then change it. this is just an example to show you how it works

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