HTML Code:
public function setValue(oldVal, newVal)
(@ oldVal) = newVal;
Bad names, here try this
HTML Code:
public function setValue(stringName, newValue)
{
(@ temp.stringName) = temp.newValue;
}
Also, all you're doing with 'this.on' is re-placing it into your core NPC...

You'd use a function like this on an item database, changing local item flags. [updating etc]