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

23 lines
575 B
Lua
Raw Normal View History

2025-06-07 08:51:21 +02:00
if not Config.HelpText then
return
end
local GetSelectedPedWeapon = GetSelectedPedWeapon
local equippedWeapon = `weapon_unarmed`
local function onWeaponEquipped(weaponHash)
equippedWeapon = weaponHash
TriggerEvent('slashtires:slashWeaponEquipped', Config.AllowedWeapons[weaponHash] ~= nil)
end
CreateThread(function()
while true do
Wait(500)
local currentWeapon = GetSelectedPedWeapon(PlayerPedId())
if currentWeapon ~= equippedWeapon then
onWeaponEquipped(currentWeapon)
end
end
end)