Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Clientside and serverside (https://forums.graalonline.com/forums/showthread.php?t=53276)

Googi 06-21-2004 01:49 AM

Clientside and serverside
 
The commands say and say2 are clientside, right?

And what about functions that have both clientside and serverside commands in them, which side of the "//#CLIENTSIDE" statement do I put them on, or how do I otherwise deal with them?

And is it okay to use "if (this.variable=number)" conditions on the clientside part of the script?

osrs 06-21-2004 02:45 AM

Quote:

Originally Posted by Googi
The commands say and say2 are clientside, right?

I think so.

Quote:

Originally Posted by Googi
And what about functions that have both clientside and serverside commands in them, which side of the "//#CLIENTSIDE" statement do I put them on, or how do I otherwise deal with them?
And is it okay to use "if (this.variable=number)" conditions on the clientside part of the script?

I did not understand this part, are you saying something like this?

Quote:

if(created) this.variable = 5;

//#CLIENTSIDE

if(playerenters){
this.var = 5;
if(this.var == this.variable) say2 Yes, it is;
}
Because the clientside part will read "this.variable" as 0, since it is on serverside part.

Googi 06-21-2004 04:59 AM

I'm talking about, like.

NPC Code:
function thing() {
this.var=3;
say2 I said something!;
}



Would that go clientside or serverside?

Trevor 06-21-2004 05:19 AM

Would depend on where you call the function from I would think.

Andy0687 06-21-2004 05:32 AM

Quote:

Originally Posted by Googi
The commands say and say2 are clientside, right?

say = client;
say2 = client/server;

Quote:

And what about functions that have both clientside and serverside commands in them, which side of the "//#CLIENTSIDE" statement do I put them on, or how do I otherwise deal with them?
Im going to use an example of how ive come to understand it, for example, on an npc i have made i use if (playertouchsme) on the serverside, and if a player has touched it, it will be destroyed. That way to prevent any other players from touching it, so only one person can get the prize. If i had put it on the clientside, it only destroyed for the player that touched it, but every other player has come and touched it too, and gotten the prize that only the first person should have gotten.

In other words, i think it is mostly about the effect you want, if they can be used on both sides.

Quote:

And is it okay to use "if (this.variable=number)" conditions on the clientside part of the script?
If you set them on the clientside, yes

DarkShadows_Legend 06-21-2004 08:17 AM

say2 works serverside and clientside for me, but say works serverside only for me.
I haven't been able to get say to work clientside. The sign just doesn't appear unless I put it serverside.

Trevor 06-23-2004 07:35 PM

Quote:

Originally Posted by DarkShadows_Legend
say2 works serverside and clientside for me, but say works serverside only for me.
I haven't been able to get say to work clientside. The sign just doesn't appear unless I put it serverside.

I don't know if `say' is officially deprecated or not, but it is in bad taste to use it.


All times are GMT +2. The time now is 02:29 PM.

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