Graal Forums  

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

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #31  
Old 08-09-2011, 08:27 PM
Adddeeee Adddeeee is offline
Registered User
Join Date: Aug 2011
Posts: 30
Adddeeee is on a distinguished road
Thank you very much! Now I think I understand the DB NPC

Although, I still have problems with the PlayerTouchsMe. It seems as if the player touches the NPC when the player is located to the top left of the NPC.

This is the NPC script:

PHP Code:
join("shop");

//#CLIENTSIDE

function onCreated()
{
  
showcharacter();
  
nick "Candy"//Sets the nickname of the character
  
ap 100//Sets the ap of the character. Also affects the colour of the nickname
  
headimg "head722.gif"//What head image to use
  
bodyimg "body8.png";   //What body image to use
  
colors[0] = "orange";     //Sets the skin colour
  
colors[1] = "lightblue";     //Sets the coat colour
  
colors[2] = "yellow";     //Sets the sleeves colour
  
colors[3] = "darkred";     //Sets the shoes colour
  
colors[4] = "lightgreen";     //Sets the belt colour
  
shieldimg "no-shield.gif"//Sets the shield image
  
shieldpower 1//Must have this or the shield won't show


and this is the shop class:

PHP Code:
function onCreated()
{
   
setShape(13232);
   
this.shop_id "basicshop";
}

function 
onPlayerTouchsMe()
{
  
this.listofitems DB_Items.getShopItems(this.shop_id);
  
triggerclient("gui""-shopcontrol"this.listofitemsthis.xthis.y);         

Am I missing something that causes the PlayerTouchsMe to fire when I'm located to the top left of the NPC?
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 01:17 PM.


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