Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

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

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

0

put else and if on the same line making it elseif up == false then

0

Ok thx ill try that

0

Ok I tried It but it still wont work

1 answer

✓ Accepted answer

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.

7 comments

0

ok thx but i dont Know how To use Elseif

0

it wont Work

0

elseif works like a 'if' basically but can be used multiple times.

0

show me your changed script

0

make sure only 'if' and 'elseif' no elses

0

ok

0

there i putted it i the original one

This discussion is preserved as it was. New answers, comments, and votes are closed.