View Single Post
  #1  
Old 12-26-2001, 11:53 PM
Androk2k1 Androk2k1 is offline
Banned
Androk2k1's Avatar
Join Date: Dec 2001
Posts: 1,336
Androk2k1 is on a distinguished road
Help! Stock Market Script!

OK I am having problems with NPC taking money from the player. Here's a script:
--- Script ---
// NPC made by Androk
// Stocks
// Variables:
// this.ANTamount - Amount of ANT stock.
// this.function - Function that is happening
// (0 - Nothing, 1 - stock name, 2 - amount of stock).
// this.BUYamount - Temparary amount of stocks to buy.

if (playerenters) {
toweapons Stocks;
}
if (playerchats) {
tokenize #c;
if (strequals(#t(0),buy)) {
this.BUYamount=#t(2);
if (strequals(#t(1),ANT)&&playerrupees>server.ANTpric e*this.BUYamount-1) {
playerrupees-=server.ANTprice*this.BUYamount;
this.ANTamount+=this.BUYamount;
}
}
}
Reply With Quote