Detecting a players team

I want to make a friendly fire system, and i need to detect what team the character is in.
:grinning:

player.Team

or:

local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
if Player then
   local Team = Player.Team
end

Depends on how you want to get it.

Important note:
Team is an ObjectValue.
Inside your script,
check if the player [ through the GetPlayerFromCharacter function on the enemy’s character]'s team is equal to it.

If it is, return end [stop the function].

2 Likes

Return end if the player you hit’s team is = to your team.