Can someone help me with this script
--------------------------- -- V A R I A B L E S -- --------------------------- local Teams = game:GetService("Teams") local AD = Teams["Administrative Department"] local CI = Teams["Chaos Insurgency"] local CD = Teams["Class-D Personnel"] local DEA = Teams["Department of External Affairs"] local EC = Teams["Ethics Committee"] local FP = Teams["Foundation Personnel"] local IA = Teams["Intelligence Agency"] local ISD = Teams["Internal Security Department"] local MD = Teams["Medical Department"] local MTF = Teams["Mobile Task Force"] local ScD = Teams["Scientific Department"] local SD = Teams["Security Department"] local RRT = Teams ["[REDACTED]"] local ADG = Teams["[CLASSIFIED]"] --------------------------- -- M A I N S C R I P T -- --------------------------- -- Hides Name game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(c) repeat wait() until c:FindFirstChild("Humanoid") c.Humanoid.DisplayDistanceType = Enum.HumanoidDisplayDistanceType.None end) end) -- Adds Nametag game.Players.PlayerAdded:Connect(Respawn) function Respawn(Player) local Tag = script.Tag:Clone() local User = Tag.Frame.NameTag local Group = Tag.Frame.GroupTag local Rank = Tag.Frame.RankTag wait() Tag.Parent = Player.Character.Head Tag.Adornee = Player.Character.Head User.Text = Player.Name if Player.TeamColor == AD.TeamColor then -- Administrative Department Group.Text = "Administrative Department" Group.TextColor3 = Color3.fromRGB(060,135,065) Rank.Text = (Player:GetRoleInGroup(6133330)) Rank.TextColor3 = Color3.fromRGB(060,135,065) elseif Player.TeamColor == CI.TeamColor then -- Chaos Insurgency Group.Text = "Chaos Insurgency" Group.TextColor3 = Color3.fromRGB(00, 00, 00) Rank.Text = (Player:GetRoleInGroup(0)) Rank.TextColor3 = Color3.fromRGB(00, 00, 00) elseif Player.TeamColor == RRT.TeamColor then -- Rapid Response Team Group.Text = "[REDACTED]" Group.TextColor3 = Color3.fromRGB(255, 00, 00) User.Text = "" Rank.Text = "" Rank.TextColor3 = Color3.fromRGB(255, 00, 00) elseif Player.TeamColor == CD.TeamColor then -- Class D User.Text = "" Group.Text = "" Rank.Text = "" --Nothing, managed by a Script. elseif Player.TeamColor == DEA.TeamColor then -- Department Of External Affairs Group.Text = "Department Of External Affairs" Group.TextColor3 = Color3.fromRGB(255, 0, 191) Rank.Text = (Player:GetRoleInGroup(3002582)) Rank.TextColor3 = Color3.fromRGB(255, 0, 191) elseif Player.TeamColor == EC.TeamColor then -- Ethics Committee Group.Text = "Ethics Committee" Group.TextColor3 = Color3.fromRGB(180, 210, 228) Rank.Text = (Player:GetRoleInGroup(5986810)) Rank.TextColor3 = Color3.fromRGB(180, 210, 228) elseif Player.TeamColor == FP.TeamColor then -- Foundation Personnel Group.Text = "Foundation Personnel" Group.TextColor3 = Color3.fromRGB(205, 205, 205) Rank.Text = (Player:GetRoleInGroup(5734609)) Rank.TextColor3 = Color3.fromRGB(205, 205, 205) if Player.TeamColor == ADG.TeamColor then -- [DATA EXPUNGED] Group.Text = "[CLASSIFIED]" Group.TextColor3 = Color3.fromRGB(060,135,065) User.Text = "" Rank.Text = "" Rank.TextColor3 = Color3.fromRGB(060,135,065) elseif Player.TeamColor == IA.TeamColor then User.Text = "[REDACTED]" Group.Text = "" Rank.Text = "" elseif Player.TeamColor == ISD.TeamColor then User.Text = "[REDACTED]" Group.Text = "" Rank.Text = "" elseif Player.TeamColor == MD.TeamColor then -- Medical Department Group.Text = "Medical Department" Group.TextColor3 = Color3.fromRGB(4, 175, 236) Rank.Text = (Player:GetRoleInGroup(4770592)) Rank.TextColor3 = Color3.fromRGB(4, 175, 236) elseif Player.TeamColor == MTF.TeamColor then -- Mobile Task Force User.Text = "" Group.Text = "" Rank.Text = "" elseif Player.TeamColor == RRT.TeamColor then -- REDACTED User.Text = "[REDACTED]" Group.Text = "" Rank.Text = "" elseif Player.TeamColor == ScD.TeamColor then -- Scientific Department Group.Text = "Scientific Department" Group.TextColor3 = Color3.fromRGB(9, 137, 207) Rank.Text = (Player:GetRoleInGroup(4735585)) Rank.TextColor3 = Color3.fromRGB(9, 137, 207) elseif Player.TeamColor == SD.TeamColor then -- Security Department Group.Text = "Security Department" Group.TextColor3 = Color3.fromRGB(163, 162, 165) Rank.Text = (Player:GetRoleInGroup(4738774)) Rank.TextColor3 = Color3.fromRGB(163, 162, 165) elseif Player.TeamColor == ADG.TeamColor then -- REDACTED User.Text = "[CLASSIFIED]" Group.Text = "" Rank.Text = "" end while wait() do if Player.Name == "gorani" then User.Text = "The Adminstrator" Rank.Text = "????????????" elseif Player.Name == "CrunchyIceCream342" then User.Text = "O5-X" Rank.Text = "O5 Council" elseif Player.Name == "CrunchyIceCream344" then User.Text = "O5-X" Rank.Text = "O5 Council" elseif Player.Name == "" then User.Text = "O5-2" Rank.Text = "O5 Council" elseif Player.Name == "" then User.Text = "O5-3" Rank.Text = "O5 Council" elseif Player.Name == "" then User.Text = "O5-4" Rank.Text = "O5 Council" elseif Player.Name == "" then User.Text = "O5-5" Rank.Text = "O5 Council" elseif Player.Name == "" then User.Text = "O5-6" Rank.Text = "O5 Council" elseif Player.Name == "" then User.Text = "O5-7" Rank.Text = "O5 Council" elseif Player.Name == "" then User.Text = "O5-8" Rank.Text = "O5 Council" elseif Player.Name == "Agency_Jake" then User.Text = "O5-9" Rank.Text = "O5 Council" elseif Player.Name == "" then User.Text = "O5-10" Rank.Text = "O5 Council" elseif Player.Name == "" then User.Text = "O5-11" Rank.Text = "O5 Council" elseif Player.Name == "" then User.Text = "O5-12" Rank.Text = "O5 Council" elseif Player.Name == "" then User.Text = "O5-13" Rank.Text = "O5 Council" elseif Player.Name == "" then User.Text = "" Rank.Text = "" elseif Player.Name == "" then User.Text = "" Rank.Text = "" elseif Player.Name == "" then User.Text = "" Rank.Text = "" end end end function onPlayerEntered(Player) Player.Changed:connect(function(property) if (property == "Character") then Respawn(Player) end end) end game.Players.PlayerAdded:connect(onPlayerEntered)
it keeps sending error called Syntax error expected 'end' to close 'fountion' line 45], got <eof> did you forgot to close 'then' at line 311
I'm too dumb and lazy to understand the WHOLE code, but I'm pretty sure you forgot to close the function that you made called "Respawn(player)". So you closed all the blocks with an "end" after line 293, but I think you need to add another "end" on line 299 to close the "Respawn(player)" function. Just make sure you finished writing the Respawn function.
And the second error. I don't really know what's the problem. I don't understand why you added 2 extra ends after line 308. Also, I am sorry if this didn't solve the problem. I am a beginner scripter myself