Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   New Scripting Engine (GS2) (https://forums.graalonline.com/forums/forumdisplay.php?f=153)
-   -   Help please :[ (https://forums.graalonline.com/forums/showthread.php?t=86816)

coolman87 07-10-2009 08:09 AM

Help please :[
 
okay so basically im trying to make a script and yeah i know theres alot of things that can be done to format better but i simplified it alot to try and find the problem, anyway i got the idea from zack on npulse and its just a "stamp" npc where you say /stamp account message and itll put a message by the player and follow them around.
so i put this in the weapon. I put an echo script and couldnt get it to echo so its not triggering but i dont know why.

PHP Code:

function onActionServerside() {
if (
params[0]=="stamp") {
echo(
params[0],params[1],params[2]);
findPlayer(params[1]).x=temp.x+1.5;
findPlayer(params[1]).y=temp.y+1.5;
serverr.stamp=params[2];
with (putnpc2(temp.xtemp.y"join soren_stamp;"))
{
  
this.follow_account params[0];
}
}
}
//#CLEINTSIDE
function onPlayerChats() {
t=player.chat.tokenize();
if (
t[0]=="/stamp") {
triggerServer("gui",name,"stamp",t[1],t[2]);
}
}

// and this in the class

function onCreated() {
this.chat=serverr.stamp;
settimer(.05);
}
function 
onTimeout() {
this.chat=serverr.stamp;
warpto(this.follow_account);
settimer(.05);



Angel_Light 07-10-2009 08:49 AM

wouldn't it be easier to just do a showText using findimg by the player rather than an NPC if your just doing text?

Example:

PHP Code:

function onActionServerside()
{

  switch ( 
params0])
  {

    case 
"stampOn":

      
temp.pl findPlayerparams1]);

      
pl.clientr.stamp params2];
      
pl.triggerClient"gui"nameparams0]);

    break;

    case 
"stampOff":

      
findPlayerparams1]).clientr.stamp NULL;

    break;


  }
}

//#CLIENTSIDE

function onPlayerChats()
{

  
temp.tokens player.chat.tokenize();

  if ( 
tokens0] == "/stamp")
    
triggerServer"gui"name"stampOn"tokens1], tokens2]);

  else if ( 
tokens0] == "/removestamp")
    
triggerServer"gui"name"stampOff"tokens1]);

}

function 
onActionClientside()
{

  if ( 
params0] == "stampOn")
    
onTimeout();

}

function 
onTimeout()
{

  if ( 
clientr.stamp != NULL)
  {

    
with findImgthis.index))  // Adjust attributes to your liking
    
{

      
player.x;
      
player.y;

      
zoom 0.45;

      
text clientr.stamp;

    }

    
setTimer0.05);

  }

  else
    
setTimer0);  



Here's a Link for those Attributes.

TShowImg

coolman87 07-10-2009 09:03 AM

I don't really know what that does so maybe. But idk i want the player to still be able to talk and the npc be a sort of stamp that follows you.

Angel_Light 07-10-2009 09:15 AM

Updated my first post.

coolman87 07-11-2009 06:36 AM

that dissapears when the chat goes down, i want it to stay until i remove it.

Angel_Light 07-11-2009 07:18 AM

works fine for me, just mess with the code some yourself.

Mark Sir Link 07-11-2009 11:41 AM

Quote:

Originally Posted by coolman87 (Post 1505835)
okay so basically im trying to make a script and yeah i know theres alot of things that can be done to format better but i simplified it alot to try and find the problem, anyway i got the idea from zack on npulse and its just a "stamp" npc where you say /stamp account message and itll put a message by the player and follow them around.
so i put this in the weapon. I put an echo script and couldnt get it to echo so its not triggering but i dont know why.

function onActionServerside() {
if (params[0]=="stamp") {
echo(params[0],params[1],params[2]);
findPlayer(params[1]).x=temp.x+1.5;
findPlayer(params[1]).y=temp.y+1.5;
serverr.stamp=params[2];
with (putnpc2(temp.x, temp.y, "join soren_stamp;"))
{
this.follow_account = params[0];
}
}
}
//#CLEINTSIDE
function onPlayerChats() {
t=player.chat.tokenize();
if (t[0]=="/stamp") {
triggerServer("gui",name,"stamp",t[1],t[2]);
}
}

// and this in the class

function onCreated() {
this.chat=serverr.stamp;
settimer(.05);
}
function onTimeout() {
this.chat=serverr.stamp;
warpto(this.follow_account);
settimer(.05);
}

check bolded

12171217 07-12-2009 06:34 AM

Regardless of how his spelling failed hard, he should be using showtext instead.


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

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