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

How do I do this?

So I am trying to write a script so if your in this team then something happens. But this is the closest guess I have xD

if game.Workspace.LocalPlayer.
-- After that I get really confused...

How do I do it correctly?

1 comment

0

This question is a little too broad to answer accurately. Please provide more information to give you better help.

1 answer

✓ Accepted answer

I'll take my best guess at what you mean.

function isOnTeam(player, teamColor)
return player.TeamColor == teamColor;
end

Simply use it as

if isOnTeam(yourPlayer, yourTeamColor) then
-- Do things
end

Your question is however far too vague, and you're giving us too little to work on to provide you with a suitable and tailored answer.

2 comments

0

Why would anyone down vote your answer for trying? Was -1 before I up voted. 

0

What I mean is like the localplayer not a specific player name.

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