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
  #1  
Old 08-11-2011, 08:20 PM
Adddeeee Adddeeee is offline
Registered User
Join Date: Aug 2011
Posts: 30
Adddeeee is on a distinguished road
Triggeraction from weapon to putnpc2- NPC

Hi! (again)

Sorry for yet another new thread, but it seems as if I'm stuck again!

I'm trying to do a staffblock. The idea is that when you left-click the mouse a staffblock will appear with the current player.chat set as it's own chat. When you right-click the mouse the block shall be destroyed.

Can't seem to locate where I go wrong.

Class:

PHP Code:
function onCreated()
{
  
setShape(13232);
  
setimg"block.png" );
}

function 
onDeleteBlock()
{
  
this.destroy();

Weapon:

PHP Code:
function onActionServerSide(xy)
{
  
temp.npc putnpc2(11"");
  
temp.npc.join("staffblock");
  
temp.npc.chat player.chat;
}

//#CLIENTSIDE
function onMouseDown()
{
  if(
player.weapon == this)
  {
    if(
leftmousebutton)
    {
      if(
player.weapon == this)
        
triggerserver("weapon"this.namemousexmousey);
    }
    
    if(
rightmousebutton)
    {
      
player.chat mousex SPC mousey;
      
triggeraction(mousexmousey"DeleteBlock"null);
    }
  } 

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:41 AM.


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