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
COMMUNITY QUESTION
How do I make this script Compatible with Filtering Enabled? Accepting more Answers
2 answers
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.
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
you're trying to change the player's team from the client. the game will not accept the change because filtering is enabled, so the client needs to invoke some signal to a server-sided script that will respond by changing the team. All of the things that you do on the client that directly change things in the game are not going to replicate with filtering enabled.