ID:263917
 
Code:
mob/proc/Levelup()
var/multiweaponstat = list("str"=0.5,"mhp"=20.15,"mdef"=0.6,"def"=0.5,"mstr"=0.31,"msp"=3.12)
var/twinbladestat = list("str"=0.51,"mhp"=20.38,"mdef"=0.8,"def"=0.6,"mstr"=0.31,"msp"=4.19)
if(src.exp >= src.mexp)
if(src.level<150)
src.mexp+= src.level*rand(80,120)
if(src.multiweapon)
for(var/o in multiweaponstat)
usr.[o] += o

if(!src.multiweapon)
if(src.Class == "Twin Blade")
for(var/o in twinbladestat)
usr.[o] += o


Problem description:
im having trouble using these nested variables for my levelup system. can someone tell me what im doing wrong?

Try usr.mystat[o]+=multiweaponstat[o]

Replace mystat with whatever name you have for your stat list.
usr is inappropriate here. That should be src, not usr.

Lummox JR
In response to Traztx
hmm as lummox jr said its not good to use usr in a proc =/ also put the codes inside dm tags >.>

...:::Pirata Inmortal:::...
In response to Aang-Air bender
codes are in dm tags... and also it doesnt seem to work, it gives me a index run time error