for i,v in pairs(script.Parent.Parent.Parent.Parent.Parent.PlayersTouching:GetChildren()) do
local player = game.Players.LocalPlayer
player.TeamColor = BrickColor.new("Sea green")
end
This script I made is in a model that is related to a door with a box inside that has players touching it. It is a regular script that at one point after some waiting time and etc. changes the players' team. In studio when I test this it works perfectly fine (and yes filtering enabled is on so I've tried using remote functions on this too) but when I play it in an actual game server it doesn't change the team. Can someone explain why?

6 comments
Because you're doing it locally. And please use variables, I have no idea what those billion script.Parents lead to.
@incapaz how do i not do it locally?
you can't get the localplayer in a normal script
Your script is a bit confusing, but from what I understand, you have a part, and at certain times you want everyody who is touching that part to switch teams to Sea Green, right? I may be able to help you with that, just tell me if that's what you're looking for
Yes that is in fact what I am looking for
Hmmm ok hold on I'll write a script soon