The leveling system I am using wont work, instead of leveling, it goes past its mark and never levels
mob
proc
level()
if(usr.exp >= usr.maxexp)
usr.level += 1
usr.maxexp += usr.maxexp
usr.exp = 0
else
return
client
var
HP = 100
MAXHP = 100
level = 0
exp = 0
maxexp = 100
No errors here, it just wont work.
ID:261192
![]() Oct 8 2001, 4:31 am
|
|
Are you even calling level()? If not....well, thats the only reason I can think of. It doesnt automatically work by itself. Read up on some basics! (Faq,ZBT are both good places to start)
Alathon |
Himura Kenshin wrote:
The leveling system I am using wont work, instead of leveling, it goes past its mark and never levels Assuming you're actually calling level() in your code somewhere, I'd say the problem is that you're using usr instead of src. The usr value is only set to deal with verbs and such, so in this case you should be using src. Lummox JR |
Ack yeah missed that it said usr, that would cause the same thing, you cant use usr in a proc
Alathon |
Alathon wrote:
Ack yeah missed that it said usr, that would cause the same thing, you cant use usr in a proc Since in single-player games, usr should always be the player anyway, my guess is you were still right; changing usr to src is just preventative maintenance to avoid a worse bug in multiplayer testing. I noticed the same thing you did about no apparent call to level(). Lummox JR |
Try this:
mob
proc
level()
if(usr.Exp>=usr.maxexp)
usr.level+=1
usr.exp=0
usr.maxmxp+=50
usr<<"You have gained a Level"
else
return
client
var
HP = 100
MAXHP = 100
level = 0
exp = 0
maxexp = 100
Evil_SSJ4Vegeta