ID:143120
 
Code:A leveling system
obj
Dark_Forces
icon = 'Obj.dmi'
icon_state = "Book1"
density = 1
verb
Read_Book()
set src in oview(1)
usr.exp += 10
usr.EXPcheck()



mob
proc/EXPcheck(mob/M)
if(M.exp == M.maxexp)
M<<"You Level Up!"
M.level += 1


Problem description:The usr.EXPcheck proc doesnt work *sniff* *sniff* Can u help me?

There was no need to do EXPcheck(mob/M) because you're only using it for one person, which would be src. and you call it using usr.EXPcheck(). You was also doing if(src.exp == src.maxexp) that means if its equal to. so it if goes over, the proc wont work. So you need equal or greater then, here's the fixed code.

obj
Dark_Forces
icon = 'Obj.dmi'
icon_state = "Book1"
density = 1
verb
Read_Book()
set src in oview(1)
usr.exp += 10
usr.EXPcheck()



mob
proc/EXPcheck()
if(src.exp >= src.maxexp)
src<<"You Level Up!"
src.level += 1
EXPCheck shouldn't have an argument. Remove that, and replace M with src. Additionally, you will need to change == to >=, as it will be possible for exp to become greater than maxexp. Finally, you will want to either decrease exp or increase maxexp, or once the player levels up, they will continue levelling up every time they gain experience.
In response to Scizzees
Kk ty
In response to Chrislee123
you might wanna do this
mob
proc/EXPcheck()
if(src.exp >= src.maxexp)
src<<"You Level Up!"
src.level += 1
src.exp -= src.maxexp//minus the maxexp from the exp so the exp goes back down put saving the extra exp
src.maxexp*2//mutiplies the maxexp by 2 so you dont have the same maxexp