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

Local Script in textlabel Wont update its display, even though it does for the other one?

Asked by
Nozazxe 107
4 years ago
Edited 4 years ago

So i made an EXP viewing script but it doesnt update? Like, when i level up it increased the exp you need to level up but it doesnt show that. It just shows "100 / 0 EXP"

It works for my other one that displays the level.

heres the script for exp:

1local player = game.Players.LocalPlayer
2local expLimit = 100 * (player.leaderstats.Level.Value) -- you start at level 1 btw
3 
4while true do
5wait()
6script.Parent.Text = expLimit.." / "..player.leaderstats.Experience.Value.." EXP"
7end

1 answer

Log in to vote
2
Answered by 4 years ago

Variable must be inside the loop to reflect any value changes.

1local player = game.Players.LocalPlayer
2 
3while true do
4wait()
5local expLimit = 100 * (player.leaderstats.Level.Value) -- you start at level 1 btw
6script.Parent.Text = expLimit.." / "..player.leaderstats.Experience.Value.." EXP"
7end
Ad

Answer this question