ID:147734
 
I want it so when the exp = max exp the player levels up yet it isn't working.

proc
Levelup()
if(usr.exp <= usr.maxexp)
src.lvl += 1
src.maxpl += 100
src.maxki += 3
src.str += 2
src.maxexp += 15
src << "You gain a level"
src << "Your PL went up 100"
src << "Your Ki went up 3"
src << "Your Strength went up 2"
else
..()

what seems to be the matter ????
First, you're using usr in a proc, which is a no-no. Second, your if() is checking if usr's exp is less than or equal to their max exp. You probably want to check if the exp is greater than or equal to the max. Third, where are you calling this procedure? If it's never called, the code inside is never executed, and nothing happens. Also, you don't really need the else ..(). Since this is a proc you have defined yourself, there is no parent code for ..() to run. ..() doesn't do anything in this case.
In response to Jon88
mob
Stat()
statpanel("Statistics")
stat(src)
stat("")
stat("[usr.name]", "")
stat("Race:","[race]")
stat("Alignment:","[ally]")
stat("")
stat("Level:","[lvl]")
stat("Power:","[pl]/[maxpl]")
stat("Ki:","[ki]/[maxki]")
stat("Exp:","[exp]/[maxexp]")
stat("stamina:","[stamina]%")
stat("Strength:","[str]")
stat("Money:","$[money]")
stat("Guild:","[guild]")


proc
Levelup()
if(src.exp >= src.maxexp)
src.lvl += 1
src.maxpl += 100
src.maxki += 3
src.str += 2
src.maxexp += 15
src << "You gain a level"
src << "Your PL went up 100"
src << "Your Ki went up 3"
src << "Your Strength went up 2"
else
..()

that is what i got with the level up system yet it still ain't working
In response to Ultifighter
When are you calling the Levelup() procedure? If you never call it, the code inside it never runs, and it never checks to Levelup() a player. Any time you give the player exp, you should call Levelup() on them.
In response to Jon88
Jon88 wrote:
When are you calling the Levelup() procedure? If you never call it, the code inside it never runs, and it never checks to Levelup() a player. Any time you give the player exp, you should call Levelup() on them.


Thank you