Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting > New Scripting Engine (GS2)
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #11  
Old 01-03-2014, 10:29 PM
iDigzy iDigzy is offline
Registered User
Join Date: Apr 2013
Posts: 44
iDigzy is on a distinguished road
Quote:
Originally Posted by cbk1994 View Post
In the future please use [PHP] tags to format code.

Your trigger is fine except that it looks like you're using the code in an NPC (since you use onPlayerTouchsMe). You can't trigger NPCs the same way you trigger weapons. You would either have to do a triggerAction at the NPC's position, or a fancier trigger (like triggering a weapon or DB NPC).

However, since you're using it in an NPC, you don't even need a trigger. onPlayerTouchsMe gets called serverside, too, so you can just do...

PHP Code:
function onPlayerTouchsMe() {
  
// you can move this line clientside if you don't want everyone to see
  // the chat change
  
this.chat player.nick SPC "welcome to Castaway! To get started talk to Brian the skiller outside just outside of here";
  
player.clientr.tutorial 1;

(if this doesn't work, you may need to set the shape of the NPC serverside by using setShape).
Thanks for the quick response , that seems to work. However if I try to make it work for clientside so only the player sees the chat it does not work. I was wondering if it would make much of a difference if I used player.client.tutorial=1; instead of clientr as client seems to work on clientside. Or would it be better to do a trigger in an npc so it can use clientr?
__________________
Reply With Quote
 


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 07:27 PM.


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