I'm making a minigame where two teams of three control zombies with swords in an arena by stepping on buttons. The objective of the minigame is to eliminate the other team. However, it's possible for members of the same team to kill each other's zombies. The name of each of the zombies are RedTeam, RedTeam2, and RedTeam3, along with GreenTeam, GreenTeam2, and GreenTeam3 for the other team. I want to edit the sword script so if the zombies have a certain name they cannot be killed. Here is the killing script for the swords the zombies carry:
function onTouched(hit)
local human = hit.Parent:findFirstChild("Zombie")
if (human ~= nil) then
human.Health = human.Health - 10
end
end
--if (script.Parent ~= nil) and (script.Parent.className == "Part") then --Work if in a block
-- connection = script.Parent.Touched:connect(onTouched)
--end
script.Parent.Touched:connect(onTouched)
