Hello! I'm having difficult with my leaderstats display GUI not wanting to update properly. Player generates in lobby, teleports to map, defeats opponents and money/exp/level increases on the leaderstats display in the upper right, and on my GUI, I have a separate GUI for each value. But once the round ends and the player is sent back to the lobby, the leaderstats in the GUI vanishes. (They still display correctly in the upper right corner.) When the player is teleported to the next map for the next round, the GUI will not update until the player earns more points/exp/level up. I want the GUI to remain up to date in the lobby too. :/ Any thoughts?
I have a Screen GUI, with a Text Box inserted and this local script inside the Text Box:
game.Players.LocalPlayer.leaderstats.Level.Changed:connect(function(newValue) script.Parent.Text = "Level: ".. game.Players.LocalPlayer.leaderstats.Level.Value end)
With "Level" replaced with "Points" and "EXP" for the other two leaderstat displays.
Answer was discovered with the suggestion by yanderbae
local plr = game.Players.LocalPlayer local level = plr.leaderstats.Level while true do wait() script.Parent.Text = "Level: ".. level.Value end