You're missing two ends to end your for loop and function.
The code should look like this,
01 | local player = game.Players.LocalPlayer |
03 | player.CharacterAdded:connect( function (character) |
06 | local scripts = character:WaitForChild( "Scripts" ) |
08 | for i, localscript in pairs (scripts:GetChildren()) do |
09 | if localscript:IsA( "LocalScript" ) then |
10 | if not localscript.Disabled then |
11 | localscript.Disabled = true |
12 | localscript.Disabled = false |
17 | for i, gui in pairs (game.ReplicatedStorage.ServerStorage:GetChildren()) do |
18 | if player.TeamColor = = game.Teams [ "Axis Forces" ] .TeamColor then |
19 | if player.PlayerGui then |
20 | gui:Clone().Parent = player.PlayerGui |
That should stop the errors.
There is just a small optimization issue that's annoying me. You used a player added function where one is not needed. The script will not run until it gets Replicated
To the player. Meaning we can safely run the code knowing it will only run for that local player from the beginning of the script. Here's what the optimized script will look like,
01 | local player = game.Players.LocalPlayer |
04 | local scripts = player:WaitForChild( "Scripts" ) |
06 | for i, localscript in pairs (scripts:GetChildren()) do |
07 | if localscript:IsA( "LocalScript" ) then |
08 | if not localscript.Disabled then |
09 | localscript.Disabled = true |
10 | localscript.Disabled = false |
15 | for i, gui in pairs (game.ReplicatedStorage.ServerStorage:GetChildren()) do |
16 | if player.TeamColor = = game.Teams [ "Axis Forces" ] .TeamColor then |
17 | if player.PlayerGui then |
18 | gui:Clone().Parent = player.PlayerGui |
Good luck!