I want it to stop at lvl 2 but it will just keep on going And when it reaches lvl 2 i want it to say MAX! but it will only go up in lvl's it wont stop and i wont get any erro from it whats the problem PLZ help
lvl = script.Parent.Up.LVL
local LVL = player.leaderstats.LVL
tool = script.Parent
exp = lvl.Value
max = 2
val = 20
tool.Activated:connect(function()
if LVL.Value == max then
up = true
LVL.Value = "MAX!"
elseif up == false then
lvl.Value = lvl.Value + 1
up = true
wait(0.5)
up = false
if lvl.Value >= val then
LVL.Value = LVL.Value + 1
lvl.Value = 0
val = val + 10
end
end
end)
here is the elseif but it still wont work

3 comments
put else and if on the same line making it elseif up == false then
Ok thx ill try that
Ok I tried It but it still wont work