Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

how do i detect a team color? [Answered]

Asked by 5 years ago
Edited 5 years ago

heyo so I'm making a game where you click a button and if your team's color is Cork then it opens a gui. (i have the gui) I don't really know where to start. thx

0
Mind telling us how much teams you have? s_iara 94 — 5y
0
Three SamZeKat 28 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

Detecting team colours is pretty simple. Inside a Player, there is a value called "TeamColor". Then you would need to access that team colour by checking the team colours in the teams folder. A basic example of detecting a team colour with a print script would be as follows.

if Player.TeamColor = game.Teams.Team.TeamColor then
    print("Team Found!")
end
0
thanks :P SamZeKat 28 — 5y
0
No problem dude itchymoonfire 179 — 5y
0
sadly it does not work. SamZeKat 28 — 5y
0
its having trouble with the Player. SamZeKat 28 — 5y
0
That's because you have to declare what the player is. itchymoonfire 179 — 5y
Ad
Log in to vote
0
Answered by 5 years ago

heres my script ~~~~~~~~~~~~~~~~~function clicked() if Player.TeamColor == game.Teams.wait.cork then print("Team Found!") end end script.Parent.ClickDetector.MouseClick:Connect(clicked)

~~~~~~~~~~~~~~~~~

Answer this question