I’m trying to fetch a player’s team for a portable radio tool to show their team, however, I cannot obtain their team from the workspace.Player (local player)–perhaps there’s another way?
I looked for some help here and the only possible way I could think of is somehow obtaining the player’s name color and see if it matches an associated team but I don’t know where to find (I also tried to use player.name.color==team1.teamcolor just to try something)
Sample Code:
(I already know how to fetch teams from team service, thats what variables Team1&2 are)
local ROLE=""
local Players = game:GetService("Players")
local player = Players.LocalPlayer
if player.Name.Color==Team1.TeamColor then
ROLE=" [Team1]"
end
if player.Name.Color==Team2.TeamColor then
ROLE=" [Team2]"
end
I’ve also tried:
local localplayerteam = game.Players.LocalPlayer.Team
if localplayerteam==Team1 then
ROLE=" [Team1 ]"
end
if localplayerteam==Team2 then
ROLE=" [Team2 ]"
end
error for both: Team is not a valid member of Model “Workspace.Juicy_Fruit”
Any ideas?