Giter Site home page Giter Site logo

coffee-buffs-progressbar-speed's Introduction

Coffee-Buffs-Progressbar-Speed

Made by Sunny Scripts Discord: https://discord.gg/WK7nYmDhrN (24/7 support and updates) Tebex: https://sunny-scripts.tebex.io/ Kofi:https://ko-fi.com/sunnyscripts

Description

  • Drinking coffees make all your progressbar faster for a duration of time set.

Feel free to let me know how it should be done better ;) Check out my store above for more NoPixel inspired scripts and support. Love you all.

Inspired by Project Sloth's spirits <3

Installation

1.

  • Go to qb-smallresources> client> consumables.lua and CTRL+F / FIND RegisterNetEvent('consumables:client:Drink', function(itemName)

  • REPLACE FROM

        TriggerEvent("inventory:client:ItemBox", QBCore.Shared.Items[itemName], "remove")
        TriggerEvent('animations:client:EmoteCommandStart', {"c"})
        TriggerServerEvent("QBCore:Server:SetMetaData", "thirst", QBCore.Functions.GetPlayerData().metadata["thirst"] + ConsumeablesDrink[itemName])
  • TO

        TriggerEvent("inventory:client:ItemBox", QBCore.Shared.Items[itemName], "remove")
        if itemName == 'coffee' then
            TriggerEvent("progressbar:client:faster", 30)
        end
        TriggerEvent('animations:client:EmoteCommandStart', {"c"})
        TriggerServerEvent("QBCore:Server:SetMetaData", "thirst", QBCore.Functions.GetPlayerData().metadata["thirst"] + ConsumeablesDrink[itemName])

2.

  • GO TO progressbar > client > main.lua, ADD this anywhere at the top
local faster = false
local time = 0

local function Buff(time)
    local t = time * 60
    CreateThread(function ()
        while true do
            if t > 0 then
                faster = true
            else
                faster = false
                break
            end
            Wait(1000)
        end
    end)
end
RegisterNetEvent("progressbar:client:faster", function (time)
    Buff(time)
end)
  • FIND function Process(action, start, tick, finish) and REPLACE THIS

    SendNUIMessage({
    action = "progress",
    duration = Action.duration,
    label = Action.label
    })
  • TO THIS
    local dur = Action.duration
    if faster == true then
      dur = (Action.duration * 2) / 10
    else
      dur = Action.duration
    end
    SendNUIMessage({
    action = "progress",
    duration = dur,
    label = Action.label
    })

coffee-buffs-progressbar-speed's People

Contributors

q4d1952k avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.