I am trying to make a switch team script and I am at the last part where I have to get the script to go invisible but it seems wherever I put the last part of code it doesn't work.
Script:
game.StarterGui.TeamSwitchGui.MainFrame.Visible = true local TC = Instance.new("RemoteEvent") TC.Name = "TeamChanger" TC.Parent = game.ReplicatedStorage TC.OnServerEvent:Connect(function(Player, TeamName) Player.Team = game.Teams[TeamName] game.StarterGui.TeamSwitchGui.MainFrame.Visible = false -----Part that is not working Player:LoadCharacter() end)
Please help.
You have to access the player's PlayerGui. You cannot edit what the players see with StarterGui. So, this should work:
TC.OnServerEvent:Connect(function(player, teamName) player.PlayerGui.TeamChangeGUI.Enabled = false end)