ID:161295
 
mob/proc
Level(type,gain)
usr.type.value+=1


How can I make it so that if I call Level(nin,rand(1,50)) that I don't have to do:
var/x=rand(1,3)
if(type=="nin")
nin.max_value+=x
if(type=="tai")
tai.max_value+=x
if(type=="gen")
gen.max_value+=x


I hope it's understandable what I want, and I hope I'm able to do it with your help.

Regards,

Rick
You can use the vars list for this; look it up in the DM Reference. But if that's all your proc there does, it's quite pointless, isn't it?
In response to Kaioken
Hmm, could you please explain me how I'd put it, then?
I did look it thorough, but it doesn't seem so clear to me.
Thanks anyway for your time.
In response to Sokkiejjj
datum/proc/dynamically_set_var(varname,value)
src.vars[varname] = value