Pixel Development
  • Information
    • 👋Welcome!
    • 📄Terms Of Service
  • Scripts
    • 🍔Consumables
      • 🔍Installation
      • ⚙️Configuration
      • 🛠️Extra Configuration
Powered by GitBook
On this page
  1. Scripts
  2. Consumables

Extra Configuration

If you would like to add your own custom progressbar and notify then you would do it like shown below! This can all be done inside client/editable.lua.

-- Custom Progressbar
function Consumables.Editable.Progressbar(name, label, duration, useWhileDead, canCancel, disableControls, animation, prop, propTwo, onFinish, onCancel, icon)
    if prop and prop.model and (prop.coords and prop.coords.x and prop.coords.y and prop.coords.z) and (prop.rotation and prop.rotation.x and prop.rotation.y and prop.rotation.z) then
        prop = {
            hash = prop.model,
            bone = prop.bone or nil,
            position = prop.coords,
            rotation = prop.rotation
        }
    else
        prop = nil
    end

    if animation and animation.task then
        local scenario = {
            name = animation.task,
            enterAnim = true
        }
        animation = nil
    elseif animation and animation.animDict and animation.anim then
        animation = {
            dict = animation.animDict,
            anim = animation.anim,
            blendIn = animation.blendIn,
            blendOut = animation.blendOut,
            duration = animation.duration,
            flag = animation.flags,
            playbackRate = animation.playbackRate,
            lockX = animation.lockX,
            lockY = animation.lockY,
            lockZ = animation.lockZ
        }
    end

    if type(disableControls) == "table" then
        local disable = {
            move = disableControls.disableMovement,
            car = disableControls.disableCarMovement,
            combat = disableControls.disableCombat,
            mouse = disableControls.disableMouse,
            sprint = disableControls.disableSprint
        }
    end

    local status = exports["is_ui"]:ProgressBar({
        title = label,
        icon = icon,
        duration = duration,
        useWhileDead = useWhileDead,
        canCancel = canCancel,
        prop = prop,
        animation = animation,
        scenario = scenario,
        disable = disable
    })

    if status == true then  
        if onFinish then
            onFinish()
        end
    elseif status == false then
        if onCancel then
            onCancel()
        end
    end
end

-- Custom Notify
function Consumables.Editable.CustomNotify(title, text, texttype, duration, icon)
    exports["is_ui"]:Notify(title, text, duration, texttype, icon)
end

-- Custom Stress
function Consumables.Editable.CustomStress(type, amount)
    if type == 'gain' then
        TriggerEvent("aty_hud:stress:add", amount)
    elseif type == 'decrease' then
        TriggerEvent("aty_hud:stress:decrease", amount)
    end
end
PreviousConfiguration

Last updated 9 months ago

🍔
🛠️