how do i make an explosion when a part is clicked?
COMMUNITY QUESTION
how do i make an explosion when 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)
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.

2 comments
my man it's not a gui button
bro its click detector