wasd
DiscordTebex
  • Welcome
  • Getting Started
    • What is Escrow
  • Other Things
    • Editing localization files
  • Resources
    • Mix-Weed
      • Installation
      • How To Do
        • Items
        • Config
      • Modules
        • Weed Type
        • Recipe Type
          • Recipe onUsed
    • ATM Robbery [Free]
      • Items
    • 24/7 Shop
    • Multiplayer Delivery Job
    • 🗞️Multiplayer Newspaper Job
    • Multiplayer Garbage Job
    • Multiplayer Tow Job
      • Exports / Events
    • Daily Rewards Script
Powered by GitBook
On this page
  1. Resources
  2. Mix-Weed
  3. Modules
  4. Recipe Type

Recipe onUsed

Example onUsed events

RegisterNetEvent('wasd-mixweed:weed:useRolledWeed', function()
    -- Relieve stress
    local relieveStress = 20
    TriggerServerEvent('hud:server:RelieveStress', relieveStress)

    local playerPed = PlayerPedId()
    local effects = {
        { set = 'move_m@drunk@slightlydrunk', duration = 60000 }, -- Slightly walking effect
        { set = 'move_m@drunk@moderatedrunk', duration = 60000 }, -- Stagger effect
        { set = 'move_m@drunk@verydrunk',     duration = 60000 }  -- Extreme intoxication effect
    }

    -- Select a random effect
    local randomEffect = math.random(1, #effects)
    local selectedEffect = effects[randomEffect]

    -- Request the animation set
    lib.requestAnimSet(selectedEffect.set)
    SetPedMovementClipset(playerPed, selectedEffect.set, true)
    ShakeGameplayCam('DRUNK_SHAKE', 1.0)
    RemoveAnimSet(selectedEffect.set)

    -- Remove effect after the specified duration
    Citizen.SetTimeout(selectedEffect.duration, function()
        ShakeGameplayCam('DRUNK_SHAKE', 0.0)
        ResetPedMovementClipset(playerPed, 0.0)
    end)
end)
RegisterNetEvent('wasd-mixweed:recipe:onUseDrugBlurredWater', function()
    local playerPed = PlayerPedId()
    local currentHealth = GetEntityHealth(playerPed)
    SetEntityHealth(playerPed, currentHealth - 50)

    local animDict = 'anim@scripted@nightclub@vomit@'
    local animName = 'vomit'

    lib.playAnim(playerPed, animDict, animName)

    Citizen.Wait(3000)
    ClearPedTasks(playerPed)
end)
PreviousRecipe TypeNextATM Robbery [Free]

Last updated 2 months ago