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

How to make a TextLabeles Text be a variable?

Asked by
BlagEz 26
5 years ago

This script specifically points to a level up script. I want a TextLabeles text to be a variable called Level. Level is basically a IntVal that is inside a game.Workspace, That whenever the Level Variable is changed. The TextLabel will have the Text of Level/Variable. Altought it won't work like that. Please help me of how i could fix this.

local Level = Instance.new("IntValue")
Level.Parent = game.Workspace
Level.Value = 1
while true do
    wait(1)
    Level.Value = Level.Value + 1
end

while true do
    wait(1)
    script.Parent.TextLabel.Text = Level
end

--A ScreenGui has already been added to the StarterGui--
0
Try removing the 2nd while loop and putting script.Parent.TextLabel.Text = Level after line 6. Your 2nd while loop while never run because the 1st while loop does not stop. 522049 152 — 5y
0
How do you mean setting the text label's text to an int value? I think that int value can only accept numbers... do you mean putting, the intvalue name or? AswormeDorijan111 531 — 5y
0
Its Value BlagEz 26 — 5y

Answer this question