Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Test if a play is on a certain team?

1 answer

✓ Accepted answer

Team Property of Player Objects


In Roblox, player objects have a Team property that is whatever team they are on. So, to see whether if a player is on a certain team, you would simply check if the Team property of a given player is the team you desire.

local teamname = "SomeThing"
local plr = ...
if plr.Team == game.Teams[teamname] then
	print("player on the team")
end

Hopefully this helped! Be sure to accept if it did!

1 comment

0

note that the teamname variable is there to avoid confusion

This discussion is preserved as it was. New answers, comments, and votes are closed.