Ad
Log in to vote
0

I made this LVL script Parts of it works But it wont Stop When it Reaches the Max Lvl?

Asked by 4 years ago
Edited 4 years ago

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

0
put else and if on the same line making it elseif up == false then Viking359 161 — 4y
0
Ok thx ill try that FilthyMonsterPlays 8 — 4y
0
Ok I tried It but it still wont work FilthyMonsterPlays 8 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago

You cannot use multiple 'if' statements in one scope code. Instead, you would use elseif. Or else if you're not using multiple else statements.

0
ok thx but i dont Know how To use Elseif FilthyMonsterPlays 8 — 4y
0
it wont Work FilthyMonsterPlays 8 — 4y
0
elseif works like a 'if' basically but can be used multiple times. User#18043 95 — 4y
0
show me your changed script User#18043 95 — 4y
View all comments (3 more)
0
make sure only 'if' and 'elseif' no elses User#18043 95 — 4y
0
ok FilthyMonsterPlays 8 — 4y
0
there i putted it i the original one FilthyMonsterPlays 8 — 4y
Ad

Answer this question