Thread: I feel stupid
View Single Post
  #2  
Old 11-01-2005, 11:28 PM
Lance Lance is offline
dark overlord
Lance's Avatar
Join Date: Sep 2003
Location: Space Jam Mountain
Posts: 5,072
Lance is on a distinguished road
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
Reply With Quote