Hit Script isnt working

So here is a simple script. This is apart of a fireball script where when the fireball (ball) hits something and it isnt the local player a print statement will run. Though it doesnt work and print whenever it hits both something with a humanoid and the player. Am i doing something wrong? Btw player is the local player and it already has been defined

		ball.Touched:connect(function(hit) 
			if hit.Parent:FindFirstChild('Humanoid') and hit.Parent ~= player then
				print("Touched")

The hit.Parent would be the character of the player who touched it, you could compare it with the character of the local player like this:

ball.Touched:connect(function(hit) 
	if hit.Parent:FindFirstChild('Humanoid') and hit.Parent ~= player.Character then
		print("Touched")
	end
end)
1 Like

Yooo it works! Man I feel dumb not trying that. Thanks.

1 Like