ID:144115
 
Code:
mob
verb
Meditate()
set category ="Jutsus"
if(usr.firing)
return
if(usr.resting)
return
if(usr.canmed)
return
if(usr.meditating)
usr.meditating=0
usr.move=1
usr.icon_state=null
usr.canmed=1
usr << "You Stop Meditating."
spawn(100)
usr.canmed=0
else
usr.meditating=1
usr.move=0
usr << "You Meditate."
usr.icon_state="rest"
while(usr.meditating)
sleep(pick(100,120,110))
if(prob(80))
if(usr.chakra > 5)
usr.random=rand(2,3)
if(usr.random==2)
usr<<"Your Genjutsu increases."
usr.chakra-=rand(5,10)
usr.genexp+=rand(10,15)
if(usr.random==3)
usr<<"Your Chakra increases."
usr.chakra-=rand(5,10)
usr.Mchakra+=rand(10,30)
if(usr.chakra <= 5)
usr<<"You Stop Meditating"
usr.meditating=0
usr.icon_state=null
usr.canmed=1
usr.move=1
spawn(100)
usr.canmed=0


mob
proc
Levelup()
if(src.exp>=src.max_exp)
src.level+=1
src.exp = 0
src.max_exp+=rand(20,50)
src.Mchakra+=rand(1,10)
src.taiexp+=rand(5,20)
src.ninexp+=rand(5,20)
src.genexp+=rand(5,20)
src<<"<font size = 2><b><font color = blue>You leveled up!!"
src.maxhealth+=rand(1,11)
src.taiup()
src.ninup()
src.genup()
src.nin=src.Mnin
src.tai=src.Mtai
src.gen=src.Mgen
taiup()
if(src.taiexp>=src.mtaiexp)
src.mtaiexp += rand(1,5)
src.tailvl+=1
src.taiexp = 0
src.level+=1
src.Mtai+=rand(1,5)
src.tai=src.Mtai
src<<"<font size = 2><b><font color = blue>Your Tai leveled up!!"
ninup()
if(src.ninexp>=src.mninexp)
src.mninexp += rand(1,5)
src.ninexp = 0
src.ninlvl+=1
src.Mnin+=rand(1,5)
src.level+=1
src.nin=src.Mnin
src<<"<font size = 2><b><font color = blue>Your Nin leveled up!!"
genup()
if(src.genexp>=src.mgenexp)
src.mgenexp += rand(1,5)
src.genlvl+=1
src.level+=1
src.genexp = 0
src.Mgen+=rand(1,5)
src.gen=src.Mgen
src<<"<font size = 2><b><font color = blue>Your Gen leveled up!!"


    stat("--- --- --- --- --- --- --- --- --- --- --- --- ---")
stat(" Status")
stat("--- --- --- --- --- --- --- --- --- --- --- --- ---")
stat("Level: [level]")
stat("Stamina: [health]/[maxhealth]")
stat("Chakra: [chakra]/[Mchakra]")
var/ttexp=round(src.taiexp*100/src.mtaiexp)
var/nnexp=round(src.ninexp*100/src.mninexp)
var/ggexp=round(src.genexp*100/src.mgenexp)
stat("Taijutsu: [tai] ([ttexp]%)")
stat("Ninjutsu: [nin] ([nnexp]%)")
stat("Genjutsu: [gen] ([ggexp]%)")
stat("Seals: [seals]% Accuracy")


I can't get this to work, I've tried so many things and no matter what, my Genjutsu % goes past 100 while the others get to a 100 and go back to 0 making a level up. Do you have any ideas as to what i'm doing wrong or need to change?

Still no help...
In response to Kinotsu
Your only meant to bump every 24 hours or when the topic is off the front page.



I believe whatever it is, I don't think your calling the levelup for that kind of EXP when they gain it.

And thats the last time I help a guy making a anime game...
Well, inspecting only your 'genup()' procedure, I speculate the following problems:

Are you checking every place the experience percentile gets changed? Maybe you are getting enough experience to go up more than one rank at a time, and are not checking the appropriate times? Are you accidently using the wrong variable in any place of the code?

Try answering those, should they be of help.