ID:230465
 
(See the best response by Hashir.)
i had my treadmill listed as a mob (i dont know why) and this is the code now
obj
Treadmill//name of mob
icon = 'bag.dmi'//location of icon
icon_state = "Treadmill"//name of icon
density = 0
verb//create a verb
Walk_on_Treadmill()//name of verb
set name = "Walk on Treadmill"//name of verb
set category = "Training"//Location of verb
set src in oview (1)//how close can the person be before the verb is active
if(usr.Fatigue<=75)
usr.icon_state = "run"
usr.Exp+= rand(20,400)
usr.Max_Fatigue+= rand(5,10)
usr.Fatigue++
usr << "<font size = -1>Your Endurance Has Increased"
sleep(15)
usr.icon_state = ""
Levelup()

now i get an error on the Levelup() proc saying it is undefined when i have it definded
    proc
Levelup()//the level up proc,
if(usr.Exp>=usr.MaxExp)
usr.Level+=1
usr.Exp=(usr.Exp-usr.MaxExp)
usr.MaxExp+= rand(100,1000)
usr.MaxHealth+= rand(600000000000.0,200000000000000000.0)
usr.Power+= rand(100000000000000000.0,1000000000000000000.0)
usr.Defence+= rand(200000000000000000.0,5000000000000000000.0)
usr.Strength+= rand(400000000000000000.0,1000000000000000000.0)
usr.MaxEnergy+= rand(100000000000000000.0,1000000000000000000.0)
usr<<"<font color=blue>You have gained a level"

do you guys see the issue?
Best response
You are calling Levelup() proc without specifying the caller which defaults to the parent of a procedure and in your case, the parent is obj and I assume your Levelup() proc is a mob proc. Replacing Levelup() with usr.Levelup() will fix the problem.

Also, please do not use usr in procs as it is an unsafe programming practice. For more information on this, see the usr var section in the reference.
thanks. that was stumping me for a bit.