I am trying to make a game where the moon falls and explodes, but the explosion script is not working. Can somebody please tell me what is wrong?

script.Parent.Anchored = false
	script.Parent.CanCollide = true
	 
	if not script.Parent:FindFirstChildOfClass("BodyVelocity") then
	    BodyVelocity = Instance.new("BodyVelocity",script.Parent)
	    BodyVelocity.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
	    BodyVelocity.Velocity = Vector3.new(0,-250,0)
	end
	 
	script.Parent.Touched:Connect(function(Part)
	    local Explosion = Instance.new("Explosion",workspace)
	 
	    Explosion.BlastRadius = 2000
	    Explosion.BlastPressure = 2000
	    Explosion.Position = script.Parent.Position
	    Explosion.ExplosionType = Enum.ExplosionType.CratersAndDebris
	    script.Parent:Destroy()
	end)

3 comments

0

Parent the explosion into the moon not the workspace.

0

the moon is destroyed because of line 17; i don't think you wanted to destroy the moon, at least not until the explosions are done happening

0

The first question was a request: https://scriptinghelpers.org/questions/66288/i-need-help-with-this-falling-moon-because-im-not-sure-what-to-do-can-i-get-help You were spoon fed an answer. This is not your script.