Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Triggering a weapon clientside (https://forums.graalonline.com/forums/showthread.php?t=83781)

Codein 01-20-2009 04:29 PM

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.

xXziroXx 01-20-2009 04:37 PM

Try:

PHP Code:

(@clientr.equipped[2]).trigger("PrimaryFunction"""); 

If not:

PHP Code:

(@clientr.equipped[2]).PrimaryFunction(); 


Make sure it's a public function.

Codein 01-20-2009 04:39 PM

Quote:

Originally Posted by xXziroXx (Post 1458451)
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 :)


All times are GMT +2. The time now is 04:27 PM.

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