
12-26-2001, 11:53 PM
|
|
Banned
|
 |
Join Date: Dec 2001
Posts: 1,336
|
|
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;
}
}
} |
|
|
|