How to Check What Team a Player is on

I have a team called No Team. I am making an if statement to check if the players is on No Team. How would I write this?
Thanks for your time.

3 Likes

Index the player and the team, then check if the player’s Team property is that specified team.

local Player = game:GetService("Players").Player1
local Team = game:GetService("Teams")["No Team"]

if Player.Team == Team then
    -- your code here
end
27 Likes

Also if you want to just check if it’s truly no team you can check if not player.Team which would work if they aren’t on a team and not a defined team by you

4 Likes