ID:141698
 
Code:
mob
var
life = 100
maxlife = 100
exp = 0
maxexp = 100
level = 1
strength = 5
defense = 5
munny
weapon
Stat()
statpanel("Status")
stat("", src.icon)
stat("Name", src.key)
stat("Level", src.level)
stat("Health","[src.life]/[src.maxlife]")
stat("Strength", src.strength)
stat("Deffence", src.defense)
stat("Experience","[src.exp]/[src.maxexp]")
stat("")
stat("")
stat("")
stat("Munny", usr.munny)
statpanel("Inventory",usr.contents)
proc/death_check(mob/M as mob)//handles death
if(src.life <= 0)
M <<"You killed [src]!"
if(src.client)
src <<"[M] killed you!"
src.loc = locate(5,6,1)
src.life = src.maxlife
else
src <<"You have been killed by [M]!"
del(src)
view() << "\blue [src] dies!"
spawn()
proc/skill_up()
src.strength += rand(2,10)
src.defense += rand(3,10)
src.maxlife += rand(1,20)
src.life = src.maxlife
src <<"\blue You leveled up!"
proc/level_up()
if(src.client)
if(src.exp >= src.maxexp)//if the players exp matches or is higher then the players maxexp
src.skill_up()
src.level += 1//adds a level
src <<"\red You gained a Level!"
src.maxexp *= 2
src.exp = 0//exp back to zero
else
return..()


Ok well i got this so far and it is used the proc skill_up() to upgrade the users stats everytime you level up but everytime i try and compile it their is a error that says invalid expression... what am i doing wrong? i'm wondering if after the skill_up() proc do i have to make it call the parent?

It'd be handy if in the future, when asking about a compile error, you tell us which line it is referring to.

At the end of the death_check() proc you use the spawn()proc. The spawn proc with no parameters runs the statement following it after all other immediately pending events have finished.
You don't have any statements after you use spawn()
The compiler can't find any, so it errs.