Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 11-27-2013, 05:12 PM
Jakov_the_Jakovasaur Jakov_the_Jakovasaur is offline
Deleted by Darlene159
Jakov_the_Jakovasaur's Avatar
Join Date: Sep 2013
Location: Deleted by Darlene159
Posts: 353
Jakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud ofJakov_the_Jakovasaur has much to be proud of
Quote:
Originally Posted by iDigzy View Post
Well I haven't posted a question on here in a bit, but I ran into another problem. I want to make a script that sets the players tag. I'm not sure if this script is correct in any way/or if I over thought it. Can someone tell me whats wrong :o?
Graal Script Code:
function onActionSeverside(tags){
if (
tokens[0] == "/tag"){
player.guild "Elepahnt";
}
}

//#CLIENTSIDE
function onPlayerChats(){
if (
player.chat == "/tag"){
temp.tokens player.chat.tokenize();
triggerServer("gui"this,nametags);
}

  • the 2nd parameter for triggerserver(); is the name of the object you are communicating with, you have a comma after 'this' instead of a dot
  • you are storing 'player.chat.tokenize()' as 'temp.tokens', but you are not sending temp.tokens as a parameter, you are sending 'tags' which is undefined
  • because you have already established the player is using the tag command on clientside, it is not necessary to check this condition on serverside
  • it is not necessary to send the full array of tokenized chat, you only need to send the 2nd value, which is temp.tokens[1]

Graal Script Code:
function onActionSeverside(temp.tag){ 
  
player.guild temp.tag;


//#CLIENTSIDE 
function onPlayerChats(){ 
  if (
player.chat.starts("/tag")){ 
    
temp.tokens player.chat.tokenize(); 
    
triggerServer("gui"this.nametemp.tokens[1]); 
  } 

__________________
This signature has been deleted by Darlene159.

Last edited by Jakov_the_Jakovasaur; 11-27-2013 at 08:44 PM.. Reason: thank you!
Reply With Quote
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 05:43 PM.


Powered by vBulletin® Version 3.8.3
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright (C) 1998-2008 Linux cyberjoueurs All Rights Reserved.