ID:1880323
 
(See the best response by Nadrew.)
GetEXP(mob/m)
if(m.HP<=0)
usr.EXP += m.mobEXP
usr<<"You gained [m.mobEXP] Experience"
GetLevel()
if(usr.EXP >= usr.MaxEXP)
usr.Level++
usr<<"You Leveled up to Level [usr.Level]."</b>


Problem description: I was trying to add a Experience System to my game.I am pretty new to Dm so i was not sure how to code it. I have no errors on this code but no text msg pops up and i dont get the Exp. If you have questions to the vars and where i placed them tell me. Please help because I tried everything. Thanks :3

Best response
Are you actually calling the GetExp() proc anywhere? You'd need to call it in say, a monster's DeathCheck() proc like

player.GetEXP(monster)


(Obviously an example).
Oh I finnaly understand what a friend was saying. I asked so many people I was afraid of showing my dumbness. Thank you very much!
Gonna try it out so nothing is wrong with the coding over there?
Well, you shouldn't be using 'usr' in those procs, 'src' would be much more reliable for every case there. Outside of that for a simple system it looks fine.
Thank you. It works now I'm gonna replace it with src then. I also have to call the Getlevel proc under it right?
It tells me src.Exp undefined var.
Yes, you'd need to call GetLevel(), if it's telling you the variable is undefined you probably have those procs defined under the wrong scope.

Should be.

mob
proc
GetEXP()
// Etc


And not

proc
GetEXP()
Oh ok thank you very much for the help!