Leaderboard gui username is glitching and bug - need help scripter

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    to fix my leaderboard gui username glitching

  2. What is the issue? Include screenshots / videos if possible!
    when i join the game
    the username gui its keep glitching into
    another username gui

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    To create new gui
    replace the old gui into new gui
    nothing work

repeat
wait()
until game:IsLoaded()

local players = game:GetService(“Players”)
local runService = game:GetService(“RunService”)
local starterGui = game:GetService(“StarterGui”)
local teams = game:GetService(“Teams”)
local tweenService = game:GetService(“TweenService”)
local userInputService = game:GetService(“UserInputService”)

local screenGui = script:FindFirstAncestorWhichIsA(“ScreenGui”)

local uiToggle = true
local uiCellScale = screenGui.Ui.Main.ListHolder.UIGridLayout.CellSize.Y.Scale

screenGui.Enabled = true

while true do
local layoutOrder = 1

starterGui:SetCoreGuiEnabled(Enum.CoreGuiType.PlayerList, false)

for _, frame in pairs(screenGui.Ui.Main.ListHolder:GetChildren()) do
if (frame:IsA(“Frame”)) then
frame:Destroy()
end
end

for _, team in pairs(teams:GetTeams()) do
if team.Name ~= “UNIT” and #team:GetPlayers() > 0 then
local teamFrame = screenGui.Template.Team:Clone()
teamFrame.BackgroundColor3 = team.TeamColor.Color
teamFrame.LayoutOrder = layoutOrder
teamFrame.Name = string.format(“[Team] %s”, team.Name)
teamFrame.Parent = screenGui.Ui.Main.ListHolder
teamFrame.Visible = true
teamFrame.TeamName.Text = team.Name

  	for _, player:Player in pairs(team:GetPlayers()) do
  		if player.Team.Name ~= "UNIT" then
  			local playerFrame = screenGui.Template.Player:Clone()
  			playerFrame.LayoutOrder = layoutOrder
  			playerFrame.Name = string.format("[Player] %s", player.Name)
  			playerFrame.Parent = screenGui.Ui.Main.ListHolder
  			playerFrame.Visible = true
  			
  			if player.Team == game.Teams.Mafia then
  				local mafia = game.ReplicatedStorage.Remotes.MafiaSystemFunction:InvokeServer("getplayermafiadataOTHER", player.UserId)
  				
  				if mafia then
  					playerFrame.PlayerName.Text = mafia["MafiaName"].." - "..player.Name
  				end
  				
  			else
  				playerFrame.PlayerName.Text = player.Name
  				
  			end
  			
  			
  			local sub = player:WaitForChild('Values', 3):WaitForChild('Subdivision', 3)
  			
  			if not sub then return end
  			
  			if sub.Value and sub.Value ~= '' then
  				playerFrame:FindFirstChild('PlayerName').Text = sub.Value..' - '..player.Name
  				local color = Color3.new(1, 1, 1)
  				local realColor = color
  				if require(game:GetService('ReplicatedStorage'):FindFirstChild('Modules'):FindFirstChild('SubColors'))[sub.Value] then
  					realColor = require(game:GetService('ReplicatedStorage'):FindFirstChild('Modules'):FindFirstChild('SubColors'))[sub.Value]
  				end
  				playerFrame:FindFirstChild('PlayerName').TextColor3 = realColor
  			end
  		end
  	end

  	layoutOrder += 1
  end

end

screenGui.Ui.Main.ListHolder.UIGridLayout.CellSize = UDim2.new(1, 0, 0, screenGui.Ui.Main.AbsoluteSize.Y * uiCellScale)

task.wait(0.8)
end

userInputService.InputBegan:Connect(function(input, gameProcessedEvent)
if not (gameProcessedEvent) then
if (input.KeyCode == Enum.KeyCode.Tab) then
uiToggle = not uiToggle

  	if (uiToggle) then
  		tweenService:Create(screenGui.Ui.Main, TweenInfo.new(1), {Position = UDim2.fromScale(0.995, 0.01)}):Play()
  	else
  		tweenService:Create(screenGui.Ui.Main, TweenInfo.new(1), {Position = UDim2.fromScale(0.995 + 0.5, 0.01)}):Play()
  	end
  end

end
end)

1 Like

if anyone need video i can send and show the proof

im closing this to better new one

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.