Suggestion: put the following in a class and join in to the player
PHP Code:
function onCreated() {
this.setTimer(1);
}
// this should really be optimized to stop the timer if ≥100 and
// restart it when they use mana and it needs to regen
function onTimeOut() {
if (this.clientr.mudmp < 100) {
this.clientr.mudmp ++;
}
this.setTimer(1);
}
Not only is it much more secure, it also cuts down on wasted bandwidth (and is much simpler)

. Not many people take advantage of the ability of timeouts to be used on the player object.