While creating a script, I needed to access recoils.lua to retrieve weapon recoil values. However, I noticed there wasn't an export available for this functionality. To solve this, I created a simple export, tested it, and it worked perfectly with my script. Although a small change, this could be helpful for others in the future.
Export Code:
exports('GetWeaponRecoil', function(weaponName)
local hash = GetHashKey(weaponName)
return recoils[hash] or 2.0
end)
EDIT - place before the eventhandler.
While creating a script, I needed to access recoils.lua to retrieve weapon recoil values. However, I noticed there wasn't an export available for this functionality. To solve this, I created a simple export, tested it, and it worked perfectly with my script. Although a small change, this could be helpful for others in the future.
Export Code:
exports('GetWeaponRecoil', function(weaponName)
local hash = GetHashKey(weaponName)
return recoils[hash] or 2.0
end)
EDIT - place before the eventhandler.