How can i make it so that it only fires if just the head gets touched

The Event fires whenever any part from the character gets touched

local Event = game.ReplicatedStorage.Swim
local Water = script.Parent
local DamageEvent = game.ReplicatedStorage.Damage
Water.Touched:Connect(function(Hit)

	local Head = Hit.Parent:FindFirstChild("Head")
	if Head then
		local Character = Head.Parent
		local Player = game.Players:GetPlayerFromCharacter(Character)
		Event:FireClient(Player,Water)
		DamageEvent:FireClient(Player,Water)
	end
end)

Just check if the hit object is the head that was found:

if Head and Hit == Head then
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.