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

changing the value of 2 text lables?

Asked by 5 years ago

I'm trying to make a script, so that when the value of one text label equals the max level of Exp, the 2nd text label will update the level by one, and the 1st text label goes back 0, while the max Exp required to level up is increased by 1.5

Here is the script

local StatsFolder = script.Parent.Parent.Parent.Parent:WaitForChild("Stats")
local ExpIntValue = StatsFolder.Exp
local LevelValue = StatsFolder.Level
local MaxExp = StatsFolder.MaxExp

LevelValue.Value = 1

script.Parent.Text = "Exp: "..ExpIntValue.Value.."/ "..MaxExp.Value
ExpIntValue:GetPropertyChangedSignal("Value"):connect(function()

MaxExp.Value = LevelValue * 1.5
print(MaxExp)

if ExpIntValue == MaxExp then 
    LevelValue.Value = LevelValue.Value + 1
    ExpIntValue.Value = 0
end


script.Parent.Text = "Exp: "..ExpIntValue.Value.."/ "..MaxExp.Value
end)



0
Are "ExpIntValue" and "LevelValue" int values(or any type of value)? Leamir 3138 — 5y
0
What is "script.Parent.Parent.Parent.Parent" User#24403 69 — 5y
0
1. the long line of "Parents is only to get the local player" CaptainGalexyCreeper 15 — 5y
0
2. The ExpIntValue and LevelValue are just the varable for the int values in the player CaptainGalexyCreeper 15 — 5y

Answer this question