Touched event not firing

I’m trying to make this growing meteor that comes down to the ground and when it touches something I want to make it explode, but touched event wont fire ( touched event is at the very bottom of my script)

debris = game:GetService("Debris")
script.Destruction.OnServerEvent:Connect(function(plr)
	print("fired")
	script.Destruction.ScreenShake.Value = true
	char = plr.Character
	rock = game.ReplicatedStorage.Items.Rock:Clone()
	rock.Parent = game.Workspace
	rock.CFrame = char.Torso.CFrame * CFrame.new(20,-1.5,0)
	rock2 = rock:Clone()
	rock2.Parent = game.Workspace
	rock2.CFrame = char.Torso.CFrame * CFrame.new(-20,-1.5,0)
	rock3 = rock2:Clone()
	rock3.Parent = game.Workspace
	rock3.CFrame = char.Torso.CFrame * CFrame.new(0,-1.5,-20)
	earth = game.ReplicatedStorage.Items.Earth
	earth.CFrame = char.Head.CFrame * CFrame.new(0,60,0)
	earth.Parent = game.Workspace
		rock4 = rock2:Clone()
	--rock3.Parent = game.Workspace
	rock4.CFrame = char.Torso.CFrame * CFrame.new(20,-1.2,0)
			rock5 = rock2:Clone()
	--rock3.Parent = game.Workspace
	rock5.CFrame = char.Torso.CFrame * CFrame.new(-20,-1.2,0)
		rock6 = rock2:Clone()
	--rock3.Parent = game.Workspace
	rock6.CFrame = char.Torso.CFrame * CFrame.new(0,-1.2,-20)
	rock7 = rock2:Clone()
	rock7.CFrame = char.Torso.CFrame * CFrame.new(20,-1.2,0)
	rock8 = rock2:Clone()
	rock8.CFrame = char.Torso.CFrame * CFrame.new(-20,-1.2,0)
	rock9 = rock2:Clone()
	rock9.CFrame = char.Torso.CFrame * CFrame.new(-20,-1.2,0)
	wait(.2)
	soulorb = game.ReplicatedStorage.Items.Soul:Clone()
	soulorb.CFrame =  char["Right Arm"].CFrame * CFrame.new(0,-1.2,0)
	soulorb.Parent = game.Workspace
	for i = 1,10 do 
	end
	r = 0 
	for i = 1,60 do wait(.005)
		r = r + 1
		rock.CFrame = rock.CFrame * CFrame.new(0,.9,0) * CFrame.Angles(0,.0,.006)
		rock2.CFrame = rock2.CFrame * CFrame.new(0,.9,0) * CFrame.Angles(0,0,-.006)
		rock3.CFrame = rock3.CFrame * CFrame.new(0,0.9,0) * CFrame.Angles(0,.006,0)
		earth.Size =  earth.Size + Vector3.new(.4,.4,.4)
	end
	r = 0
	repeat wait(.005)
		r = r + 1
		rock.Transparency = rock.Transparency + 0.05
		rock2.Transparency = rock2.Transparency + 0.05
		rock3.Transparency = rock3.Transparency + 0.05
		earth.Size =  earth.Size + Vector3.new(.4,4,.4)
	until r == 20
	debris:AddItem(rock)
	debris:AddItem(rock2)
	debris:AddItem(rock3)
	
	rock4.Parent = game.Workspace
	rock5.Parent = game.Workspace
	rock6.Parent = game.Workspace
		for i = 1,60 do wait(.005)
				earth.Size =  earth.Size + Vector3.new(.4,.4,.4)


		rock4.CFrame = rock4.CFrame * CFrame.new(0,.9,0) * CFrame.Angles(0,0,.006)
		rock5.CFrame = rock5.CFrame * CFrame.new(0,.9,0) * CFrame.Angles(0,0,-.006)
		rock6.CFrame = rock6.CFrame * CFrame.new(0,.9,0) * CFrame.Angles(0,.006,0)
		end
	repeat wait(.005)
		r = r + 1
		rock4.Transparency = rock4.Transparency + 0.05
		rock5.Transparency = rock5.Transparency + 0.05
		rock6.Transparency = rock6.Transparency + 0.05
		earth.Size =  earth.Size + Vector3.new(.4,.4,.4)
	until r == 40

	for i = 1,20 do 
		wait(.005)
		print("f")
		earth.CFrame = earth.CFrame * CFrame.new(0,-1.2,0)
	end
script.Destruction.earth.Value = true

script.Destruction.earth.Changed:Connect(function()
	print("fired")
--- wont print fired
	if script.Destruction.earth.Value == true then
		earth.Touched:Connect(function(hit)
		print(hit.Name)
		end)
	end
end)
	
end)

2 Likes

Where do you change the value of the earth Instance?

Also, please upload an place file if you can.

Test.rbxl (52.8 KB)

(updated the code)

1 Like

you should remove that because then it will print what it’s touched

1 Like

It’s not the touched function that isn’t getting called, it’s

script.Destruction.earth.Changed:Connect(function() )

Check your logic.

1 Like