DarkByte Posted September 18, 2015 Share Posted September 18, 2015 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 Link to comment
DarkByte Posted September 18, 2015 Author Share Posted September 18, 2015 Im still learning please make a example Link to comment
JR10 Posted September 18, 2015 Share Posted September 18, 2015 addEventHandler('onClientPlayerWeaponFire', localPlayer, function() if (not getControlState('aim_weapon')) then cancelEvent() end end) Link to comment
DarkByte Posted September 18, 2015 Author Share Posted September 18, 2015 Not working Link to comment
HUNGRY:3 Posted September 18, 2015 Share Posted September 18, 2015 Not working lol it works but jr forgot lua tag addEventHandler('onClientPlayerWeaponFire', localPlayer, function() if (not getControlState('aim_weapon')) then cancelEvent() end end( Link to comment
DarkByte Posted September 18, 2015 Author Share Posted September 18, 2015 Not working lol it works but jr forgot lua tag 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 Link to comment
JR10 Posted September 18, 2015 Share Posted September 18, 2015 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. Link to comment
Moderators IIYAMA Posted September 18, 2015 Moderators Share Posted September 18, 2015 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) Link to comment
DarkByte Posted September 19, 2015 Author Share Posted September 19, 2015 Still not working +No errors in debug Link to comment
DarkByte Posted September 19, 2015 Author Share Posted September 19, 2015 Ive fixed it. Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now