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
3 years ago
Edited 3 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:

local player = game.Players.LocalPlayer
local expLimit = 100 * (player.leaderstats.Level.Value) -- you start at level 1 btw

while true do
wait()
script.Parent.Text = expLimit.." / "..player.leaderstats.Experience.Value.." EXP"
end

1 answer

Log in to vote
2
Answered by 3 years ago

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

local player = game.Players.LocalPlayer

while true do
wait()
local expLimit = 100 * (player.leaderstats.Level.Value) -- you start at level 1 btw
script.Parent.Text = expLimit.." / "..player.leaderstats.Experience.Value.." EXP"
end
Ad

Answer this question