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 01-20-2009, 04:29 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Triggering a weapon clientside

I have a script up and running that detects when a key is pressed. I have done this:

PHP Code:
player.(@ clientr.equipped[2]).trigger("PrimaryFunction"""); 
Where clientr.equipped[2] is the name of a weapon, called WeaponMelee (which has a function called onPrimaryFunction)

For some reason, it is refusing to work. Is there some sort of function that returns a weapon object?

Also, the key detection is working fine.

EDIT: Tried findWeapon() with no luck.
Reply With Quote
  #2  
Old 01-20-2009, 04:37 PM
xXziroXx xXziroXx is offline
Master of Puppets
xXziroXx's Avatar
Join Date: May 2004
Location: Sweden
Posts: 5,288
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Send a message via AIM to xXziroXx Send a message via MSN to xXziroXx
Try:

PHP Code:
(@clientr.equipped[2]).trigger("PrimaryFunction"""); 
If not:

PHP Code:
(@clientr.equipped[2]).PrimaryFunction(); 

Make sure it's a public function.
__________________

"A delayed game is eventually good, but a rushed game is forever bad." - Shigeru Miyamoto
Reply With Quote
  #3  
Old 01-20-2009, 04:39 PM
Codein Codein is offline
jwd
Codein's Avatar
Join Date: Oct 2005
Location: Greater Manchester
Posts: 2,423
Codein has a spectacular aura aboutCodein has a spectacular aura about
Send a message via AIM to Codein Send a message via MSN to Codein
Quote:
Originally Posted by xXziroXx View Post
Try:

PHP Code:
(@clientr.equipped[2]).trigger("PrimaryFunction"""); 
If not:

PHP Code:
(@clientr.equipped[2]).PrimaryFunction(); 

Make sure it's a public function.
First one worked, thanks
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 09:28 PM.


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