Main/resources/[carscripts]/slashtires/bridge/inventory/ox/client.lua

24 lines
657 B
Lua
Raw Normal View History

2025-06-07 08:51:21 +02:00
if not Config.HelpText then
return
end
if not lib then
error("ox_lib was not included or did not load before this file! Please make sure to add '@ox_lib/init.lua' before shared/bridge.lua inside the fxmanifest!")
end
local function onWeaponEquipped(weaponHash)
TriggerEvent('slashtires:slashWeaponEquipped', Config.AllowedWeapons[weaponHash] ~= nil)
end
AddEventHandler('ox_inventory:currentWeapon', function(weapon)
local hash = weapon?.hash or `weapon_unarmed`
onWeaponEquipped(hash)
end)
-- For debugging
SetTimeout(0, function()
if cache.weapon then
onWeaponEquipped(cache.weapon)
end
end)