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