Constanty updating Gui

How and what would I use for a gui label that constantly updates the amount of points I have if that makes any sense? For example, if I got 5 points, the label would say 1 then 2 and so on until it reaches 5.


You’re able to use the function “.changed” to adjust the score.

So for example…

local player = game.Players.LocalPlayer
local leaderstats = player.leaderstats
local wins = leaderstats.Wins
local textLabel = script.Parent
textLabel.Text = tostring(newValue)

Just an idea.

1 Like


This topic needs a bit of editing. First of all, you can’t ask other devforum members for scripts. You need to have a reasonable script at hand in order for it to be edited. Or you can ask for help to start your script off. You can ask people to be a guide for you to create your script.


Literally just asked how can I, like what can use i.e. functions and services. I did not ask for entire scripts. The reason why I dont have one started is because I don’t know what to use. This is why I am asking.


Oh sorry! My bad. I was looking at the wrong topic! Wow this was a first time.


There’s 2 simple ways I can think of right off the bat:

  1. Value Instances:
    You can use an NumberValue (for example, there are actually many kinds of values you can use) to update points on the server, while on the client you can hook up a function to its .Changed() event and update points, more info and example here.
    However, it’s not the most reliable method; values have to be put in areas where both the client/server can access them, I would advise you not to store valuable info this way.

  2. Remote Events
    Option number 2 would be to make a Remote Event in ReplicatedStorage, where the server fires clients every time someone’s points are changed, there’s a great article on the DevHub on how to use them.

You can use a Changed property and a for loop to do this.
Basically, you will start a loop with a start value(label text) and an end value(point value). With that, you will have an increasing count that will continue until reaching the end value.


local player = game.Players.LocalPlayer
local leaderstats = player.leaderstats
local points = leaderstats.Points -- Value path

local label = script.Parent -- GUI Label

points.Changed:Connect(function() -- Changed property
	for i = tonumber(label.Text), points.Value do -- for loop
		label.Text = i -- updated text
		wait(0.25) -- cooldown