You have an extra end which you do not need.
Also, you should properly indent your code, one indent per scope.
Additionally, use RBXScriptSignal:Connect(), the lowercase version is deprecated.
Worth noting that Player.Team exists now, which is more idiomatic and preferable to setting the player's Player.TeamColor.
No need for a wait(0.5) at the top of your script, you can get rid of that.
Also variables like plyr are a waste to shorten, just call it player, we have autocomplete, typing speed doesn't matter, readability does.
local TeamsService = game:GetService("Teams")
local SpecialGroupId = 92929
local function OnPlayerAdded(Player)
if Player:IsInGroup(SpecialGroupId) then
return
end
Player.Team = TeamsService.TeamHere
end)
local Players = PlayersService:GetPlayers()
for Index = 1, #Players do
local Player = Players[Index]
OnPlayerAdded(Player)
end
game.Players.PlayerAdded:Connect(OnPlayerAdded)
2 comments
but when I delete the extra end it makes everyone go in a a neutral team instead of the team color I said
No, it has nothing to do with that. It's probably that the game.Players.PlayerAdded event listener hasn't connected by the time you've joined. I'll modify my answer to show you how to get around this.