Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #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
  #2  
Old 08-11-2011, 11:19 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
PHP Code:
function onDeleteBlock() 

  
this.destroy(); 

should be

PHP Code:
function onActionDeleteBlock() 

  
this.destroy(); 

You should probably also verify that the player is authorized to delete the block on serverside.
__________________
Reply With Quote
Reply


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 05:35 AM.


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