ID:1307921
 
(See the best response by Kaiochao.)
Code:
mob
proc
Levelup()
if(src.exp>=src.mexp)
src.level++
src.exp=0
src.mexp+=150
else


Problem description:When I run my game get to the max exp and pass it, I don't gain a level it would just go to 2000/1000 and not levl experience

Best response
Are you calling LevelUp() when your exp rises?
I am a first time coder, Please explain.
When you make your own proc, it won't do anything unless you actually use it where it should be used.
Can you give me an explain please?
Something like this. Kaiochao could do it better than me but he's the basics of what he's trying to say.

 mob
proc
DeathCheck(mob/M)
if(M.HP <= 0 && M.client)
src.exp+=rand(1,10)//give exp
src.Levelup() //call the levelup proc.

Levelup()
if(src.exp >= src.mexp)
src.level++
src.exp=0
src.mexp +=150
else return
How would I make it work in game? Calling it? If so how do I call it
I showed you. Look in the DeathCheck proc. src.Levelup() calls the procedure. Also obviously you would need an Attack proc/verb to call upon DeathCheck.
In response to Ersdfghj
If you are asking a question like that, perhaps you should spend a bit more time studying up. I will explain a bit though.

When you code a proc it's called "declaring" it.

Later on when you use it, it's called "calling" the proc.

So to call the LevelUp proc

you'd simply type:
Levelup()
In response to Ersdfghj
Ersdfghj wrote:
How would I make it work in game? Calling it? If so how do I call it


You see that thing up there that says Developers put your mouse over it and go to guide.