You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: