Hi fellow scripters! After trying to fix this issue for days, I could only come up with removing the BUTTONS, but not the whole GUI.. Could any of you guys help me out? :D
You can't remove StarterGui, as that's the instance that replicates the GUIs to the player instances, thus removing it is irrelevant to your situation.
What you can do, though, is removing the ScreenGUI object itself.
-- If this script is a system script that manages every player in the game for i, v in pairs (game.Players:GetPlayers()) do -- Get the players if v.TeamColor == "Bright blue" and v:WaitForChild("PlayerGui"):FindFirstChild("YourGuiHere") then -- If the player is in Bright blue team and has the GUI itself v.PlayerGui.YourGuiHere:Destroy() end end
If you meant to remove all of the GUIs of the players of a certain team...
for i, v in pairs (game.Players:GetPlayers()) do if v.TeamColor == "Bright blue" then -- If the player is in the Bright blue team for i, obj in pairs (v:WaitForChild("PlayerGui"):GetChildren()) do -- Gets everything in the PlayerGui if obj:IsA("ScreenGui") then -- Just in case obj:Destroy() end end end end -- Simple iteration of the players and the PlayerGuis