I’m making a system so that when a sphere is clicked, it will add one to the Player’s count, both on the leaderboard and on their personal ScreenGui count. The code I have made updates the Frame from “nil” to zero, but after that does not correspond with the value located in the “leaderstats” folder that is made under the LocalPlayer.
Your current code only checks once, you’ll need to continually check the value.
This will update the Text whenever the leaderstat is changed.
local player = game.Players.LocalPlayer
local kabobs = player:WaitForChild("leaderstats").kabobs -- the stat
kabobs.Changed:Connect(function(value) -- value is the Value of the stat. You can change the variable to whatever name you want it to be, I used "value" for this example.
print(value, "kabobs")
player:WaitForChild("PlayerGui"):WaitForChild("kabob").Frame.TextLabel.Text = tostring(value)
end)