Need help with overhead gui displaying a leaderboard stat value

This is the script


This is what i get

i want the overhead GUI to show the amount of seconds the player has but instead it’s showing 0 even tho the playtime value isn’t 0
I’ve tried asking for support in a couple discords and done a few searches online and haven’t found a fix so I’ve decided to make a post on here.

1 Like

When you create the leaderstats, do you parent them to the player before the value is fetched from the DataStore? It’s possibly 0 because the value still hasn’t been set by to the correct value by the time your code runs.

2 Likes

You’re never updating the current value. Try setting up a Changed signal on your PlayTime stats.

local playTime = player.leaderstats.PlayTime

playTime.Changed:Connect(function()
    clonedgui.TextLabel.Text = ("glassIcon" .. playTime.Value)
end)
4 Likes

image
worked great thanks a ton

1 Like