ID:2104195
 
(See the best response by Nadrew.)
mob/proc/hit()
if(src.punching==10 || src.kicking==10) src.hits+=20
if(hits>=20) GiveLevels(1)
resethits()

mob/proc/resethits()
hits=0


Problem description:

How do I make the hits reset without me stopping from hitting? Because I want it to give levels continuously whenever I hit something 20 times apparently if I don't stop from hitting after gaining a level I don't gain any levels anymore after I hit 20 more and more. So I wanted to know how to make it reset without me stopping from hitting.
Best response
You're calling resethits() regardless of whether the level is gained or not.

if(hits >= 20)
GiveLevels(1)
resethits()


However, what you're asking isn't very clear so I'm unsure if that's what you even want. The code you posted doesn't really make much sense out of context nor does the description you posted.
In response to Nadrew
Hmm I'll look into my coding, thanks anyways.