View Single Post
  #3  
Old 06-30-2011, 04:44 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Welcome to the Scripting forums.

You're mixing GS1 and GS2 together which is a bad and I believe the script isn't working as intended because you didn't make it client-side.

I personally consider message() deprecated. You can just edit the npc's text directly like you do with the player's. I.e:

this.chat = "Hello World!";

I've made a quick revision to your script with my suggested changes:

PHP Code:
//#CLIENTSIDE
function onPlayerChats() {
  if (
player.chat == "You are the most amazing NPC ever.") {
    
this.chat "That I am.";
    
sleep(3);
    
this.chat "";
  } else {
    
this.chat "Shut up, no one cares.";
    
sleep(1);
    
player.chat "Ok...";
    
sleep(1);
    
this.chat "Thats right.";
    
sleep(3);
    
this.chat "";
  }

There's a wealth of information on these forums, and on the Graal Bible / Wiki as well. You just need to search for it.

Graal Bible / Wiki:

http://wiki.graal.net/index.php/Creation/Dev/GScript

The tutorials that skillmaster mentioned can be found here:

Twinny's scripting guide
fowlplay4's scripting guide

Read through them, search the forums when you encounter problems, and feel free to look through Code Gallery scripts. We're also here to help. Good luck!
__________________
Quote:
Reply With Quote