How to detect when a part touches terrain or a base part? (either of them not both)

Hello developers, I have ran into an issue. Right now, I am scripting a ball that tweens to a certain position, and I want to detect when the ball touches either a player or terrain. However, the touched event only fires when touching a player. Is there a way to change the touched event or replace it altogether?

			if hit.Parent:FindFirstChild("Humanoid") and d == false then
				hit.Parent.Humanoid:TakeDamage(75)
				d = true
				task.wait(2)
				d = false
			end
			newWaterBall:Destroy()
			con:Disconnect()
			con=nil
		end)
		
		tween(pos)

--Let me know if you want to see the whole script by the way.

You can check the class of the hit part:

part.Touched:Connect(function(hit)
    if hit and hit:IsA("Terrain") then
        --rest of the code
    end
end)

That’s not the issue, the Touched event isn’t even running in the first place. (When it hits terrain)

bump jlkkjhkjhkjhkjhuiuiuihuihuihiuhiuhiiuiiuhiuh

help would be appreciated sldjkfsdklsdfsf

Can you give me the full script?