View Single Post
  #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