Graal Forums

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

Fulg0reSama 01-20-2011 02:02 AM

Problem
 
Yeah, I'm having quite the issue with something I'm working on.

I've created a simple statue, and I want it to change its appearance by a tokenized chat command.

This is what I have and I've checked it and It seems perfectly fine, but maybe the more keen eyes of experienced scripters can aid me.

PHP Code:

//#CLIENTSIDE
function onCreated()
{
  
showcharacter;
  
setcharprop(this.headimg,serverr.statue1head);
  
setcharprop(this.bodyimg,serverr.statue1body);
  
setcharprop(this.shieldimg,serverr.statue1shield);
  
setcharprop(this.attr[1],serverr.statue1hat);
  
setcharprop(this.colors[0],serverr.statue1c0);
  
setcharprop(this.colors[1],serverr.statue1c1);
  
setcharprop(this.colors[2],serverr.statue1c2);
  
setcharprop(this.colors[3],serverr.statue1c3);
  
setcharprop(this.colors[4],serverr.statue1c4);
  
setcharprop(this.nick,serverr.statue1nick);
  
dir 2;
}
function 
onPlayerChats()
{
  
this.tokens player.chat.tokenize();
  if (
this.tokens[0] == "/statue1" && player.account == "CertifiedGangsta252" || player.account == "Fulg0reSama")
{
  
serverr.statue1head findplayer(this.tokens[1]).headimg;
  
serverr.statue1body findplayer(this.tokens[1]).bodyimg;
  
serverr.statue1shield findplayer(this.tokens[1]).shieldimg;
  
serverr.statue1hat findplayer(this.tokens[1]).attr[1];
  
serverr.statue1c0 findplayer(this.tokens[1]).colors[0];
  
serverr.statue1c1 findplayer(this.tokens[1]).colors[1];
  
serverr.statue1c2 findplayer(this.tokens[1]).colors[2];
  
serverr.statue1c3 findplayer(this.tokens[1]).colors[3];
  
serverr.statue1c4 findplayer(this.tokens[1]).colors[4];
  
serverr.statue1nick findplayer(this.tokens[1]).nick;
  }


Trying to make this for a friend's room and I don't understand why it won't work. The serverflags aren't being written.

Admins 01-20-2011 02:12 AM

The serverr. vars can only be set on server-side, you will have to triggerserver("gui",this.name,"setstatue",this.tok ens[1]) and then in onActionServerSide() set the serverr. vars.

Fulg0reSama 01-20-2011 02:13 AM

Quote:

Originally Posted by Stefan (Post 1624265)
The serverr. vars can only be set on server-side, you will have to triggerserver("gui",this.name,"setstatue",this.tok ens[1]) and then in onActionServerSide() set the serverr. vars.

Ah, thanks. I didn't think bout that too much now did I? :p

cbk1994 01-20-2011 02:16 AM

PHP Code:

setcharprop(this.shieldimg,serverr.statue1shield); 

this should be
PHP Code:

this.shieldimg serverr.statue1shield

(and likewise for the others)


All times are GMT +2. The time now is 06:30 PM.

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