Graal Forums

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

Astram 08-28-2011 10:47 PM

NPC Help
 
I know this is a horrible question for me, since I have been scripting for a little while now, but I just noticed I've never noticed how to transfer data from serverside to clientside in level npcs.

fowlplay4 08-28-2011 10:52 PM

What/How kind/much data are you trying to send the client-side?

You can easily use attributes to make strings of data available on the client-side. I.e:

PHP Code:

function onCreated() {
  
this.attr[2] = "Hello world!";
}

//#CLIENTSIDE

function onPlayerEnters() {
  
this.chat this.attr[2]; // NPC will chat "Hello World!"


You may encounter issues if your setting data that is longer than 200 characters, but that's still a fair chunk available and there's still 30 (or 31?) attributes available.

If you need something more complicated you'll need to triggerclient to a weapon, and set it in the NPC.


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

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