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 04-14-2009, 04:44 AM
Sage_Shadowbane Sage_Shadowbane is offline
Graal Developer
Sage_Shadowbane's Avatar
Join Date: Mar 2004
Posts: 585
Sage_Shadowbane will become famous soon enough
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?
Reply With Quote
  #2  
Old 04-14-2009, 10:09 AM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
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.
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 12:14 PM.


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