|
If this is a level NPC, you should do all of that serverside.
The most compelling reason for this is security. Do you really want to trust the client's perception of clientr.eventcoin?
Other than that, there are three main flaws with your script as-is:
1) You're triggering to playerx and playery instead of somewhere on the surface of the NPC.
2) The serverside part of your NPC has no surface to trigger onto (unless there's an image set). Use a setshape to remedy this.
3) Your serverside code has no error-checking. This kinda goes along with the security thing I mentioned. What do you suppose might happen if someone has 10 event coins and says the purchase line twice in a row before the server finishes processing the first triggeraction? |
Last edited by Lance; 11-01-2005 at 11:38 PM..
Reason: elaboration
|