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

how do i make an explosion when clicked?

Asked by
Hifived 10
2 years ago

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

2 answers

Log in to vote
0
Answered by
Puppynniko 1059 Moderation Voter
2 years ago
local ClickDetector = Workspace.Part.Clickdetector
ClickDetector.MouseButton1Click:Connect(function()
    local Boom = Instance.new("Explosion")
    Boom.Position = Workspace.Part.Position
    Boom.Parent = Workspace
end)
0
my man it's not a gui button imKirda 4491 — 2y
0
bro its click detector Puppynniko 1059 — 2y
Ad
Log in to vote
0
Answered by 2 years ago
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)
0
i just want it it explode not explode the player Hifived 10 — 2y
0
then change it. this is just an example to show you how it works T3_MasterGamer 2189 — 2y

Answer this question