local Player = game.Players.LocalPlayer local Teams = game.Lighting.Teams CurrentGroup = 1020134 -- Colombians if Player:IsInGroup(CurrentGroup) then local Colombians = Teams["Colombians"] Colombians.Parent = game.Teams Player.TeamColor = BrickColor.new("Bright green") else -- Tourist local Tourist = Teams["Tourist"] Tourist.Parent = game.Teams Player.TeamColor = BrickColor.new("Bright yellow") end
I don't have time to provide a full answer, but here is one of your errors:
-- your code should be: local Teams = {} for _,v in pairs (game.Lighting.Teams:GetChildren()) do Teams[v.Name] = v end print(Teams["Tourist"].Name) -- will not return nil now, previously the keys were numbers, but I set them to the team's name
Hopefully I helped with part of your code.
~TDP
Use a regular script
That was easy
Your code doesn't appear to be doing anything important other than getting the LocalPlayer. Instead of using the LocalPlayer, put it in a regular Script to run on the server and move your code into an appropriate event such as PlayerAdded
.
Result? Success.