Advertisement
Guest User

[FiveM] Very simple custom weapon damage

a guest
Apr 22nd, 2020
608
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.34 KB | None | 0 0
  1. -- Made by Cookay for "Banaenae" that requested on the FiveM forum
  2. -- No copyright and can be used for everyone
  3.  
  4.  
  5. -- Config
  6. local allWeapons =
  7. {
  8.     --------------------------------------------------------------------------------------
  9.     -- Add here every weapons hash and the multiplier you want                          --
  10.     -- Here is a list of all weapon hash : https://wiki.rage.mp/index.php?title=Weapons --
  11.     -- The weaponModifier is a multiplier                                               --
  12.     -- you can multiply default damage to this multiplier to get new damages            --
  13.     --------------------------------------------------------------------------------------
  14.     {weaponHash = "WEAPON_PISTOL_MK2", weaponModifier = 0.1},
  15.     --{weaponHash = "WEAPON_UNARMED", weaponModifier = 0.5},
  16.     --{weaponHash = "WEAPON_ASSAULTSHOTGUN", weaponModifier = 0.05},
  17. }
  18.  
  19.  
  20. -- Function
  21. local function SetAllCustomWeaponDamage()
  22.     for k,v in pairs(allWeapons) do
  23.         SetWeaponDamageModifier(v.weaponHash, v.weaponModifier)
  24.     end
  25. end
  26.  
  27.  
  28. -- Loop
  29. Citizen.CreateThread(function()
  30.     -- Doesn't need to be in a loop, you might want to verify but i think that if you change
  31.     -- the ped it might reset all damages, so to make sure it does works on any server that would change the ped, we apply it every 30000 frames (this shouldn't affect performances)
  32.     while true do
  33.         SetAllCustomWeaponDamage()
  34.         Citizen.Wait(30000)
  35.     end
  36. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement