So, in my game I need to test if a player is on a certain team. Can anyone help me with this?
Thanks
So, in my game I need to test if a player is on a certain team. Can anyone help me with this?
Thanks
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!
note that the teamname variable is there to avoid confusion
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
pls follow https://scriptinghelpers.org/help/how-post-good-questions-answers