I have this anti teamkill script inside of a module script, which returns “true” if you can kill them, and “false” if you can’t kill them. For some reason it only works for some teams, and I do not know why. If anyone could help out that would be greatly appreciated. There are no errors in the console or anything either.
function my_functions.teamkillCheck(player, tryingToKill)
if player.Team == tryingToKill.Team then
return false
end
if player.Team ~= tryingToKill.Team then
if tryingToKill.Team == game.Teams["Grenadier Guards"] or tryingToKill.Team == game.Teams["Royal Military Police"] or tryingToKill.Team == game.Teams.Headquarters then
if player.Team == game.Teams["Grenadier Guards"] or player.Team == game.Teams["Royal Military Police"] or player.Team == game.Teams.Headquarters then
print("Player is friendly")
return false
else
print("Player is not friendly")
return true
end
elseif tryingToKill.Team == game.Teams["The irish Insurgency"] or tryingToKill.Team == game.Teams.Civilians then
if player.Team == game.Teams["The irish Insurgency"] or player.Team == game.Teams.Civilians then
print("Player is friendly")
return false
else
print("Player is not friendly")
return true
end
end
end
end