Im just starting to design a game, so this is my first time scripting. I tried to use the anti team killing script along with the sword script, heres what i tried:
local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
humanoid = workspace.DroolingZombie
Darkgreen = game.teams.Undead
if Player.TeamColor ~= Darkgreen then
tagHumanoid(humanoid)
humanoid:TakeDamage(0)
wait(1)
untagHumanoid(humanoid)
end
function tagHumanoid(humanoid, Player)
local creator_tag = Instance.new("ObjectValue")
creator_tag.Value = humanoid
creator_tag.Name = "creator"
creator_tag.Parent = Player
end
function untagHumanoid(humanoid)
if Player ~= nil then
local tag = Player:findFirstChild("creator")
if tag ~= nil then
tag.Parent = nil
end
end
end

1 comment
Please put the code in a code block