✓ Accepted answer
script.Parent.MouseClick:Connect(function()
local Explotion = `Instance.new`("Explosion")
Explotion.BlastRadius = 15
Explotion.BlastPressure = 2 * math.pow(10,6)
Explotion.Position = script.Parent.Parent.Position
Explotion.Parent = script.Parent.Parent
end)
Hi. I want to point out that the clickdetector has events that fires when certain conditions are met. For example if the player clicks or right-clicks. And, usually after that, the event is connected to a fucntion like so:
Event:Connect(function()
end)
But you can also do them like this:
function OnPartTouched()
end
script.Parent.MouseClick:Connect(OnPartTouched)
To create a new instance you use Instance.new(Class, Parent of class). You want to specify your class in the first parameter of instance.new BUT note that the second parameter, which allows you to set the parent of the object is deprecated and can cause performance issues. So it's preferable to set the parent of the object after you've declared it..