How do I add anti Team Kill to the sword Script?

I trying to add Anti Team Kill into the Sword script. But, I have no idea on adding it. :confused:

local tool = script.Parent

local idleAnim = script:WaitForChild("Idle")
local idleAnimTrack
local swingAnim = script:WaitForChild("Swing")
local swingAnimTrack

local hitCharacters = {}
local debounce = false

tool.Equipped:Connect(function()

	local humanoid = script.Parent.Parent.Humanoid
	if not idleAnimTrack then idleAnimTrack = humanoid:LoadAnimation(idleAnim) end

	idleAnimTrack:Play()
end)
tool.Unequipped:Connect(function()

	if idleAnimTrack then idleAnimTrack:Stop() end
	if swingAnimTrack then swingAnimTrack:Stop() end

end)
tool.Activated:Connect(function()

	if debounce then return end
	debounce = true

	local humanoid = script.Parent.Parent.Humanoid
	if not swingAnimTrack then swingAnimTrack = humanoid:LoadAnimation(swingAnim) end

	swingAnimTrack:Play()

	wait(0.5)	

	wait(0.5)
	debounce = false
end)
tool.Blade.Touched:Connect(function(touch)

	if hitCharacters[touch.Parent] or not debounce then return end
	if touch.Parent:FindFirstChild("Humanoid") then

		if touch.Name == "Head" then
			touch.Parent.Humanoid:TakeDamage(20)
		else
			touch.Parent.Humanoid:TakeDamage(10)
		end
		hitCharacters[touch.Parent] = true
		wait(1)
		hitCharacters[touch.Parent] = nil
	end
end)

You can make something like this:

local PlayerGetHitted = game:GetService("Players"):GetPlayerFromCharacter(touch.Parent) -- Get the player from touching.

if PlayerGetHitted.Team.Name ~= LocalPlayer.Team.Name then -- If the player that get hitted by the sword is not equal to the LocalPlayer's team then the sword will deal damage otherwise it won't.
    --Code here
end