Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

I need help I am trying to display the the person leader board stats as a GUI can you help me?

I have been trying to do this for a couple of hours but it wont work, Here is my leader board script so far.

game.Players.PlayerAdded:connect(function(plr)
    local stats = Instance.new('IntValue', plr)
    stats.Name = 'leaderstats'
    local cash = Instance.new('IntValue', stats)
    cash.Name = 'Cash'
    cash.Value = 0
    local c = game.StarterGui.Leaderboard.Frame.TextLabel
    wait()
    c.Text = "Cash: "..cash.Value

end)

I need it so it is the players stats that he/she is looking at I want it as a text label after Cash:

1 answer

✓ Accepted answer

Delete line 7,8 and 9 and make a local script in game.StarterGui.Leaderboard.Frame.TextLabel with this code:

local gui = script.Parent
local cash = game.Players.LocalPlayer:WaitForChild("leaderstats"):WaitForChild("Cash")

while wait() do
	gui.Text = "Cash: "..cash.Value
end

This discussion is preserved as it was. New answers, comments, and votes are closed.