Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 10-21-2001, 10:13 PM
freddyfox freddyfox is offline
Banned
freddyfox's Avatar
Join Date: Mar 2001
Posts: 6,705
freddyfox is on a distinguished road
Help me with script, etc.

Here's my basic menu item buying script. And yes, I DO realize how long it is:

NPC Code:

if(playertouchsme){
disabledefmovement;
this.buymode = 1;
this.startbuy = 1;
timeout = 0.05;
}
if(timeout&&this.buymode=1){
if(this.buymode = 1&&this.startbuy = 1){
playersprite = 0;
showimg 200,standardsword.gif,30,40;
showimg 201,standardsword.gif,30,45;
showimg 202,standardsword.gif,30,50;
this.select = 1;
this.startbuy = 0;
}
if(keydown(0)){
this.select --;
}
if(keydown(2)){
this.select ++;
}
if(this.select = 1){
message Short Bronze Blade / 200 GP;
showimg 203,cursor.gif,35,35+5*this.select;
sleep 0.1;
}
if(this.select = 2){
message Long Bronze Blade / 700 GP;
showimg 203,cursor.gif,35,35+5*this.select;
sleep 0.1;
}
if(this.select = 3){
message Bronze Longsword / 3549 GP ;
showimg 203,cursor.gif,35,35+5*this.select;
sleep 0.1;
}
if(this.select = 4){
this.select --;
}
timeout = 0.05;
}
if(this.select = -1){
this.select ++;
}

//--BUYING--

if(keydown(4)&&this.select=1){
if(playerrupees >= 200){
play success.wav;
message Thank you!;
playerrupees -= 200;
setsword broadgoldsword.gif,1;
timeout = 0.5;
}
}
if(keydown(4)&&this.select=2){
if(playerrupees >= 700){
play success.wav;
message Thank you!;
playerrupees -= 700;
setsword broadgoldsword.gif,2;
timeout = 0.5;
}
}
if(keydown(4)&&this.select=3){
if(playerrupees >= 3549){
play success.wav;
message Thank you!;
playerrupees -= 3549;
setsword broadgoldsword.gif,3;
timeout = 0.5;
}
}

//---Not Enough Rupees---

if(keydown(4)&&this.select=1){
if(playerrupees <= 199){
play error.wav;
message Not enough money!;
timeout = 0.5;
}
}
if(keydown(4)&&this.select=2){
if(playerrupees <= 699){
play error.wav;
message Not enough money!;
timeout = 0.5;
}
}
if(keydown(4)&&this.select=3){
if(playerrupees <= 3548){
play error.wav;
message Not enough money!;
timeout = 0.5;
}
}
if(keydown(5)&&this.buymode=1){
message ;
this.buymode = 0
enabledefmovement;
hideimg 200;
hideimg 201;
hideimg 202;
hideimg 203;
hideimg 204;
}
if(this.buymode=0){
enabledefmovement;
}




Okay, looks fine and stuff. Only problem is, if I have two merchants with this script in the same level, the script malfunctions and ceases to freeze the player.

How can I remedy this?
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 02:49 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.