Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Script Help (https://forums.graalonline.com/forums/showthread.php?t=134264061)

Equinox 08-02-2011 06:04 PM

Script Help
 
Hi, I'm not very good at scripting just wondering if somebody could take a look at this and see if it has any problems. Thanks! :D


//#CLIENTSIDE
function onCreated()
{
this.image = "block.png";
}

function onPlayerChats()
if (player.chat == "Start") && if (player.guild == "Events Team")
{
message "3";
sleep(1);
message "2";
sleep(1)
message "1";
sleep(1)
message;
}
else
if (player.chat == "Stop") && if (player.guild == "Events Team")
show();

callimuc 08-02-2011 06:28 PM

First off you should style the script to get a better look on it.

I also think you cant use:
PHP Code:

if (player.chat == "Start") && if (player.guild == "Events Team"

You can use two different ways:
PHP Code:

//first way:
if (player.chat == "Start") {
  if (
player.guild == "Events Team") {
    
//stuff
  
}
}

//seccond way:
if (player.chat == "Start" && player.guild == "Events Team") {
  
//stuff


also the command
PHP Code:

message "bla" 

is GS1. In GS2 it is
PHP Code:

this.chat "bla" 

Also at the part
PHP Code:

function onPlayerChats()
if (
player.chat == "Start") && if (player.guild == "Events Team")


it should be
PHP Code:

function onPlayerChats() {
if (
player.chat == "Start") && if (player.guild == "Events Team")


Here it´s a fixed version of yours:

PHP Code:

//#CLIENTSIDE
function onCreated() {
  
this.image "block.png";
}

function 
onPlayerChats() {
  if (
player.guild == "Events Team") {
    if (
player.chat == "Start") {
      
this.chat "3";
      
sleep(1);
      
this.chat "2";
      
sleep(1)
      
this.chat "1";
      
sleep(1)
      
this.chat "";
      
hide();
    }
    else
    if (
player.chat == "Stop") {
      
this.chat "";
      
show();
    }
  }



Equinox 08-02-2011 06:35 PM

Thanks Callimuc


All times are GMT +2. The time now is 12:46 AM.

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