Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Having trouble making a Gui that constantly updates itself on how many points there are?

Asked by
yurhomi10 192
10 years ago

This script does work. However, when I buy something during the game, it doesnt update and its just the same number the whole time. Though, it does update the points after the game has been reloaded. (shutdown & rejoin server)

points = game:GetService("PointsService")
grant = game.Workspace:FindFirstChild("Grant", true)
gui = game.Workspace:FindFirstChild("IngamePoints", true)
awardablepoints = points:GetAwardablePoints()

repeat wait() until points

if points ~= nil then
    gui.Text = awardablepoints
end

1 answer

Log in to vote
1
Answered by 10 years ago

Points will be true when it is executed, so it will end. Try making the while go until something else?

0
I tried a while loop but that didnt even work, it would still act the same. yurhomi10 192 — 10y
1
Again, you are only calling it once. You would need something like while workspace do wait() if points ~= nil then gui.Text = awardablepoints end xDeathBear 90 — 10y
Ad

Answer this question