CreateThread(function() local virtusHash = joaat('WEAPON_VIRTUS_3') local lastHasWeapon = false local lastSelected = nil while true do Wait(100) local ped = PlayerPedId() local hasWeapon = HasPedGotWeapon(ped, virtusHash, false) local selectedWeapon = GetSelectedPedWeapon(ped) if hasWeapon ~= lastHasWeapon then print( ('[ARV DEBUG] VIRTUS possession changed: %s -> %s'):format( tostring(lastHasWeapon), tostring(hasWeapon) ) ) lastHasWeapon = hasWeapon end if selectedWeapon ~= lastSelected then print( ('[ARV DEBUG] Selected weapon changed: %s'):format( tostring(selectedWeapon) ) ) if selectedWeapon == virtusHash then print('^2[ARV DEBUG] WEAPON_VIRTUS_3 has been selected^7') SetTimeout(100, function() local currentPed = PlayerPedId() print( ('[ARV DEBUG] 100ms after selection | Has weapon: %s | Selected: %s | Ammo: %s'):format( tostring(HasPedGotWeapon(currentPed, virtusHash, false)), tostring(GetSelectedPedWeapon(currentPed)), tostring(GetAmmoInPedWeapon(currentPed, virtusHash)) ) ) end) SetTimeout(500, function() local currentPed = PlayerPedId() print( ('[ARV DEBUG] 500ms after selection | Has weapon: %s | Selected: %s | Ammo: %s'):format( tostring(HasPedGotWeapon(currentPed, virtusHash, false)), tostring(GetSelectedPedWeapon(currentPed)), tostring(GetAmmoInPedWeapon(currentPed, virtusHash)) ) ) end) end lastSelected = selectedWeapon end end end)