Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Question.. (https://forums.graalonline.com/forums/showthread.php?t=85136)

Sage_Shadowbane 04-14-2009 04:44 AM

Question..
 
Im just curious as to if there is any way possible to just disable a players sword? I've tried setting the sword power to 0, and the players sword image to NULL/nil, yet the only way for it to work is to have it in a constant timeout loop. It seems the only alternative at my current state would be to just use disableweapons() and script an alternate way to fire weapons. Any help here?

Crow 04-14-2009 10:09 AM

Just use disableweapons() and use something like this to fire weapons:

PHP Code:

function onKeyPressed(codekey) {
  if (
key == "d")
    
player.weapon.trigger("WeaponFired"nil);


That should do the trick. Didn't test it though. If it doesn't work, try findWeapon(player.weapon.name).trigger("WeaponFire d", nil) instead.


Edit: For some weird reason, vB is adding some weird spaces inbetween. Just leave 'em out.


All times are GMT +2. The time now is 08:45 AM.

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