Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   triggerserver wont work? (https://forums.graalonline.com/forums/showthread.php?t=134265416)

callimuc 12-25-2011 10:55 PM

triggerserver wont work?
 
Well the script seems like itīs not triggering the server. Where is the error?

Here are some parts of the script:

This way it wont work
PHP Code:

function onActionServerSide() {
  echo(
"debug");
}

//#CLIENTSIDE
public function FireWeapon(stats) {
  
temp.action stats[0];
  
temp.freeze stats[1];
  
temp.power stats[2];
  
temp.ganis stats[3]; //walk, idle, weapon
  
temp.wname stats[4];
  
onMelee(freezepowerganiswname);
  
//triggering the server right here would work
}

function 
onMelee(freezepowerganisname) {
  
triggerServer("gui"name"Attack"); //here it wont work


but like this it would work:
PHP Code:

function onActionServerSide() {
  echo(
"debug");
}

//#CLIENTSIDE
public function FireWeapon(stats) {
  
onMelee();
}

function 
onMelee() {
  
triggerServer("gui"name"Attack"); //here it works



Crow 12-25-2011 10:59 PM

Some of your variable and function names seem like they could be reserved. Change them!

Tolnaftate2004 12-25-2011 11:48 PM

You are creating a local instance of the symbol "name" in your onMelee function signature, then the trigger is using that (so use this.name or change the function signature to resolve the name clash).

callimuc 12-26-2011 12:36 AM

Quote:

Originally Posted by Tolnaftate2004 (Post 1679494)
You are creating a local instance of the symbol "name" in your onMelee function signature, then the trigger is using that (so use this.name or change the function signature to resolve the name clash).

Oh thanks didnīt see that one ;)


All times are GMT +2. The time now is 05:59 PM.

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