Hi. I'm trying to make this GUI update its text with the current amount of points from the leaderstats. However, it stays at 200 (the set amount of points) and does not update with the script.
local currentPoints = script.Parent local leaderstats = game.Players.LocalPlayer:WaitForChild("leaderstats") if leaderstats then --Reflect the current amount of points inside the leaderstats currentPoints.Text = "$: " ..leaderstats.Points.Value end
Hi, I can help you. First you want to define the player:
plr = game.Players.LocalPlayer
Second you want to repeat a wait until leaderstats is loaded like:
repeat wait() until plr:WaitForChild("leaderstats")
Third you want to have a while loop so that it updates every second
while true do wait() script.Parent.Text = "$: " ..plr.leaderstats.Points.Value end
The whole script:
plr = game.Players.LocalPlayer repeat wait() until plr:WaitForChild("leaderstats") while true do wait() script.Parent.Text = "$: "..plr.leaderstats.Points.Value end
Remember this needs to be in a local script