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.
lua
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!
Closed as Not Constructive by User#5423
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?