Jump to content

Aiming


DarkByte

Recommended Posts

Posted

Hi. Can someone help me with a script? Its like when player not aiming and press mouse1 button or left button from mouse he is shooting. But i wanna make it only when aiming to shoot

Posted
addEventHandler('onClientPlayerWeaponFire', localPlayer, function() 
 if (not getControlState('aim_weapon')) then cancelEvent() end 
end) 

Posted
Not working

lol it works but jr forgot lua tag xD

addEventHandler('onClientPlayerWeaponFire', localPlayer, function() 
if (not getControlState('aim_weapon')) then cancelEvent() end 
end( 

Posted
Not working

lol it works but jr forgot lua tag xD

addEventHandler('onClientPlayerWeaponFire', localPlayer, function() 
if (not getControlState('aim_weapon')) then cancelEvent() end 
end( 

addEventHandler('onClientPlayerWeaponFire', localPlayer, function() 
if (not getControlState('aim_weapon')) then cancelEvent() end 
end) 

Still not working

Posted

Had a syntax error.

addEventHandler('onClientPlayerWeaponFire', localPlayer, function() 
 if (not getControlState('aim_weapon')) then cancelEvent() end 
end) 

You check use /debugscript 3 to check for errors yourself.

  • Moderators
Posted
This event is called when a player fires a weapon.

onClientPlayerWeaponFire is triggers after the bullet has been fired, that's why there is no info on the wiki about cancelEvent.

And if it did, these parameters wouldn't make any sense:(hitX, hitY, hitZ, hitElement)

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...