Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 01-20-2011, 02:02 AM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
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.
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #2  
Old 01-20-2011, 02:12 AM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
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.
Reply With Quote
  #3  
Old 01-20-2011, 02:13 AM
Fulg0reSama Fulg0reSama is offline
Extrinsical Anomaly
Fulg0reSama's Avatar
Join Date: Sep 2009
Location: Ohio
Posts: 3,049
Fulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant futureFulg0reSama has a brilliant future
Quote:
Originally Posted by Stefan View Post
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?
__________________

Careful, thoughts and opinions here scare people.
Reply With Quote
  #4  
Old 01-20-2011, 02:16 AM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
PHP Code:
setcharprop(this.shieldimg,serverr.statue1shield); 
this should be
PHP Code:
this.shieldimg serverr.statue1shield
(and likewise for the others)
__________________
Reply With Quote
Reply

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


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