View Single Post
  #2  
Old 01-09-2011, 02:47 PM
TSAdmin TSAdmin is offline
Forum Moderator
TSAdmin's Avatar
Join Date: Aug 2006
Location: Australia
Posts: 1,980
TSAdmin has much to be proud ofTSAdmin has much to be proud ofTSAdmin has much to be proud ofTSAdmin has much to be proud ofTSAdmin has much to be proud ofTSAdmin has much to be proud of
Quote:
Originally Posted by callimuc View Post
hey guys i was testing around with gui scripting and somehow i could have done 2 warping buttons

now i found a script which has a warper menu so i tested around that and after a while i got a problem. the RC keeps saying:

error: missing semicolon at line 5: setlevel2 callimap_c1.nw,10,10;
<b>error: missing semicolon at line 10: setlevel2 level2.nw,35,34;
<b>error: missing semicolon at line 15: setlevel2 level3.nw,35,44;
<b>error: missing semicolon at line 20: setlevel2 level4.nw,32,32;
<b>error: missing semicolon at line 25: setlevel2 level5.nw,29,25;

i could find any mistake so i copied the setlevel2 from other gui button (which worked) but it still keeps saying that. can anyone help?

and the scripts are:
PHP Code:
function onActionServerSide(action) {
  switch (
action) {
    case 
"Warp000":
    
setlevel2 callimap_c1.nw,10,10;
      
player.dir 2;
      
player.chat "Warped to the OSL!";
    break;
    case 
"Warp001":
      
setlevel2 level2.nw,35,34;
      
player.dir 2;
      
player.chat "Warped";
    break;
    case 
"Warp002":
      
setlevel2 level3.nw,35,44;
      
player.dir 2;
      
player.chat "Warped";
    break;
    case 
"Warp003":
      
setlevel2 level4.nw,32,32;
      
player.dir 2;
      
player.chat "Warped";
    break;
    case 
"Warp004":
      
setlevel2 level5.nw,29,25;
      
player.dir 2;
      
player.chat "Warped";
    break;
  }
}
//#CLIENTSIDE
function onCreated() {
//starting from here is gui and so on



or should i use the triggerserver?

-callimuc
It's expecting there to be no spaces between "setlevel2", and where it's going to, as such thinks that the "setlevel2" part is missing a semicolon. You're mixing GS1 with GS2. The GS2 format for setLevel2 is, using one of your lines for example:

PHP Code:
    case "Warp000":
      
player.setLevel2("callimap_c1.nw"1010);
      
player.dir 2;
      
player.chat "Warped to the OSL!";
    break; 
As you can see, the format for setLevel2() is ReferenceObject.setLevel2("LevelNameInQuotes.nw", X, Y);
__________________
TSAdmin (Forum Moderator)
Welcome to the Official GraalOnline Forums! Where sharing an opinion may be seen as a declaration of war!
------------------------
· User Agreement · Code of Conduct · Forum Rules ·
· Graal Support · Administrative Contacts ·
Reply With Quote