Korvaks is right.
Also notice, you are not checking the cps as it is removed. The player could theoretically trade the cps off to a different character and then click the button leaving them with negative cp.
Things to remember when writing npcs
1: if changing stats. UPDATE CLIENT
2: if changing anything that needs to be saved. UPDATE DATABASE/INI FILES
3: if removing something, CHECK IT FIRST (removing invent items, money, cp, etc)
4: watch your if statements carefully.
Nice to see you releasing alot of stuff (I totally understand you are new at this and there is nothing wrong with that)
Just saying... check over your code and preferably test things all the way through before you 'release' them. People appreciate releases but if the code really isn't worth using then there is no point releasing it in the first place.
That being said, keep up the good work. If you keep at it, I'm sure you'll learn really fast.
<edit>
Nvm I see now after reading more replies that lotf auto updates client for stats... interesting concept. Shocking that lotf would bother with something like that (then again... I suppose he had to noob proof the source for himself (not a flame @ anyone, just poking fun at how bad lotf usually is)
)