Hello Scripters!
So I want to make a overhead GUI, I already made the script. But what the problem is: Everytime I am on my own in the server, it just works like perfect. But whenever another player joins, the GUI switches the tag from me to him, or it just glitches between him and me.
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) local gui = game:GetService("ServerStorage"):FindFirstChild("BillboardGui") --Gets the child from the script, which would be the GUI you created local textlabel = gui.TextLabel while wait() do if player.leaderstats.Wins.Value <= 1 then textlabel.TextColor3 = Color3.fromRGB(125, 125, 125) textlabel.Text = "Newbie" gui.Parent = character.Head elseif player.leaderstats.Wins.Value >= 25 then textlabel.TextColor3 = Color3.fromRGB(85,170,0) textlabel.Text = "Good" gui.Parent = character.Head elseif player.leaderstats.Wins.Value >= 50 then textlabel.TextColor3 = Color3.fromRGB(255,30,30) textlabel.Text = "Pro" gui.Parent = character.Head elseif player.leaderstats.Wins.Value >= 100 then textlabel.TextColor3 = Color3.fromRGB(152, 39, 152) textlabel.Text = "Addicted" gui.Parent = character.Head end end end) end)
Kind Regards!
Whats going on here is that you forgot to add :Clone() on the end of the variable gui so it will take the gui from server storage and put it on the player then the gui will not exist in server storage anymore as it has been removed and put into the player do this instead
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) local gui = game:GetService("ServerStorage"):FindFirstChild("BillboardGui"):Clone() --Gets the child from the script, which would be the GUI you created local textlabel = gui.TextLabel while wait() do if player.leaderstats.Wins.Value <= 1 then textlabel.TextColor3 = Color3.fromRGB(125, 125, 125) textlabel.Text = "Newbie" gui.Parent = character.Head elseif player.leaderstats.Wins.Value >= 25 then textlabel.TextColor3 = Color3.fromRGB(85,170,0) textlabel.Text = "Good" gui.Parent = character.Head elseif player.leaderstats.Wins.Value >= 50 then textlabel.TextColor3 = Color3.fromRGB(255,30,30) textlabel.Text = "Pro" gui.Parent = character.Head elseif player.leaderstats.Wins.Value >= 100 then textlabel.TextColor3 = Color3.fromRGB(152, 39, 152) textlabel.Text = "Addicted" gui.Parent = character.Head end end end) end)
You need to do gui:Clone(), now you just change the same gui on every player. On the local gui = do local gui = game:GetService("ServerStorage"):FindFirstChild("BillboardGui"):Clone() and it will work
I think you need :Clone(), script is below, enjoy!
game.Players.PlayerAdded:Connect(function(player) player.CharacterAdded:Connect(function(character) local gui = game:GetService("ServerStorage"):FindFirstChild("BillboardGui"):Clone() local textlabel = gui.TextLabel while wait() do if player.leaderstats.Wins.Value <= 1 then textlabel.TextColor3 = Color3.fromRGB(125, 125, 125) textlabel.Text = "Newbie" gui.Parent = character.Head elseif player.leaderstats.Wins.Value >= 25 then textlabel.TextColor3 = Color3.fromRGB(85,170,0) textlabel.Text = "Good" gui.Parent = character.Head elseif player.leaderstats.Wins.Value >= 50 then textlabel.TextColor3 = Color3.fromRGB(255,30,30) textlabel.Text = "Pro" gui.Parent = character.Head elseif player.leaderstats.Wins.Value >= 100 then textlabel.TextColor3 = Color3.fromRGB(152, 39, 152) textlabel.Text = "Addicted" gui.Parent = character.Head end end end) end)