mob/proc/Hitdelay()
if(usr.spd>=0 && usr.spd<=3)
usr.delay=10
if(usr.spd>=4 && usr.spd<=7)
usr.delay=9
if(usr.spd>=8 && usr.spd<=11)
usr.delay=8
if(usr.spd>=12 && usr.spd<=15)
usr.delay=7
if(usr.spd>=16 && usr.spd<=19)
usr.delay=6
else
usr.delay=0
ID:174612
Aug 1 2003, 8:30 am
|
|
This proc doesn't do anything and I have no idea why.
|
In response to Crispy
|
|
Crispy wrote:
Oh, and it's probably better to use src rather than usr here. For a detailed explanation of this, see usr Unfriendly. If you can't be bothered reading it all, or don't understand it, just remember to use usr ONLY when you can't use anything else. =) Actually that's a really bad rule of thumb for usr, because a lot of people already mistakenly assume that's the way to use it. Like in Entered(), when they forget there's an argument to the proc: they know src is wrong, so they use usr. Instant disaster. The right rule of thumb is: No put usr in proc. Ungh. Lummox JR |
In response to Crispy
|
|
That didnt work
Heres the proc: mob/proc/Hitdelay() And here is the verb that runs it mob/pbag/verb/punch() I've asked several people and they can't find anything wrong with it. I'd really appreciet it if someone could fix it. I don't get any errors but when I punch, there is no delay. |
In response to Tokabol
|
|
usr.Hitdelay()i know it might not seem like much, but have you tried using it without the ? eg. usr.Hitdelay() |
In response to Lazyboy
|
|
That was supposed to be an html tag but it didnt work.
|
In response to Tokabol
|
|
I found out that the proc does work but not like I wanted to. It just delays the time before he punches but the stat gain doesn't change. How should I run the proc so that the stat gain slows down.
|
In response to Tokabol
|
|
I fixed it, it works just the way I want to so theres no need to respond to this post. A moderator may close it if they wish.
|
This is the problem. Look carefully at the actual logic of the code. You're doing all those other ifs, and then you undo all that effort by effectively saying "if usr.spd is less than 16 or larger than 19, set usr.delay to zero". Whoops... =)
All of those ifs (except the first one) should be changed to "else if". Then it should work.
Oh, and it's probably better to use src rather than usr here. For a detailed explanation of this, see usr Unfriendly. If you can't be bothered reading it all, or don't understand it, just remember to use usr ONLY when you can't use anything else. =)