Advance Medical System - visn_are

Related Script Changes to note when working with visn_are

Documentation: https://veryinsanee.github.io/visn_are_docs/ https://docs.veryinsanee.space/advanced-roleplay-environment/ Exports: exports["visn_are"]:GetSharedFunctions().{function()} exports["visn_are"]:GetSharedVariables().Table.Field Scripts that have exports (can use to see how exports work): qs-smartphone /resources/[phone]/qs-smartphone-pro/client/custom/misc//OpenPhone.lua:3

if isDead() or not canOpenPhone or exports["visn_are"]:GetSharedVariables().ClientHealthBuffer.unconscious then return end

Script Changes: /resources/[custom_scripts]/[ems]/visn_are/script/custom/hooks.lua:6-26

HookEventHandler(ENUM_HOOKABLE_EVENTS.UNCONSCIOUS_STATE_CHANGED, function(newState)
    function lockInv(toggle)
        if toggle then LocalPlayer.state:set("inv_busy", true, true) TriggerEvent('inventory:client:busy:status', true) TriggerEvent('canUseInventoryAndHotbar:toggle', false)
        else LocalPlayer.state:set("inv_busy", false, true) TriggerEvent('inventory:client:busy:status', false) TriggerEvent('canUseInventoryAndHotbar:toggle', true) end
    end
    if newState then -- Player is unconscious now

        -- This disables the player from peaking/"targeting" anyone when talking
        exports['pma-voice']:overrideProximityCheck(function(player)
            return false
        end)
        lockInv(true) -- Disables use of qs-inventory
    else -- Player is conscious now true
        exports['pma-voice']:resetProximityCheck() -- Resets Players Voice Allowing them to speak again 
        lockInv(false)
    end

    ResetThirstHungerStatus()
end)

Last updated