Jump to content

Regulating a weapons fire rate


-Blaze-

Recommended Posts

Hey guys,

I'm trying to make a script that can regulate the fire rate of various weapons without using ( setWeaponProperty ) , since the fire rate can only be changed on server side, but i want each player to have a different shooting speed.

Any methods on how this can be done?

Link to comment
  • Moderators
Hey guys,

I'm trying to make a script that can regulate the fire rate of various weapons without using ( setWeaponProperty ) , since the fire rate can only be changed on server side, but i want each player to have a different shooting speed.

Any methods on how this can be done?

No.

Only an overwrite in lua might make it possible.

Which is far from real bullets and afaik not even close to your lua skills.

Link to comment

There's still some luck but, not really efficient as you wish.

You can increase or decrease the client's gamespeed when firing a certain weapon, then you reset it to default when he stops firing. I know that doesn't change a weapon property, but it does it.

  
speed = false 
  
function changeSpeed(weapon, _, _, _, _, _, _) 
if speed == false then 
setGameSpeed(4) 
speed = true 
addEventHandler("onClientRender",root,checkFiring) 
end 
end 
addEventHandler("onClientPlayerWeaponFire", root, changeSpeed) 
  
  
function checkFiring() 
if getPedTask ( localPlayer, "secondary", "TASK_SECONDARY_ATTACK" ) ~= "TASK_SIMPLE_USE_GUN" then 
removeEventHandler("onClientRender",root,checkFiring) 
speed = false 
setGameSpeed(1) 
end 
end 
  

Link to comment

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...