[FREE] [OX] WX Headbag - Put bag on other player's head so he can't see

static (7)
Hello everyone, today I am releasing another script of mine, which is WX Headbag!
This script is perfect for roleplaying servers, especially for non-legal style. This script allows you to put bag on other player’s head so he can’t see. This is based 100% on ox_lib, which is compatible with EVERY framework! If you don’t want to use target, that’s okay, you can turn it off in the config and instead use an usable item. I am putting some screenshots down below as well with the config file! I hope you enjoy! You will also need ox_inventory

[DOWNLOAD] GitHub

Config File

Important!

  • For target support, you need ox_target
  • This script has a little bug, where if you put a bag on player, take it off and try to put it again, you’ll get an error saying he already has a bag on his head. For now idk how to fix it, but just press “put on” again.

Screenshots






More of my work

[PAID] WX AntiCheat - Advanced, affordable anticheat that actually works!

[FREE] WX Core - Essential script pack
[FREE] WX Users - Admin utility to see player id, name and status
[FREE] WX Blips - Simple blip creator
[FREE] WX Reports - Simple Chat-based report system with built-in admin-only chat

5 Likes

If only… statebags existed

GetPlayerPed(-1) all the way.

it’s open source anyways so no point in complaining and PR improvements instead.
2 Likes

Bro stop reposting other people’s stuff

Reposting? Can you send me the link of the original?

This is the QB version, and also only rewritten esx_headbag

Any way to let people that has the bag on there head remove it after so long , in case someone leaves the server ?
Maybe also after 15 mins or so the bag auto gets removed?

I can see a lot of people trolling and leaving it on a person.

you can add something like this to the event after putting headbag on player:

Citizen.CreateThread(function()
    while true do
        Wait(60*1000*minutes)
        TriggerEvent('remove:headbagevent')
        break
    end
end)

In client or server?

hey, try this in client.lua, replace the event wx_headbag:putOn with this:

RegisterNetEvent('wx_headbag:putOn') -- Simple trigger to put on the headbag
AddEventHandler('wx_headbag:putOn', function()
    Headbag = CreateObject(GetHashKey("prop_money_bag_01"), 0, 0, 0, true, true, true)
    AttachEntityToEntity(Headbag, GetPlayerPed(-1), GetPedBoneIndex(GetPlayerPed(-1), 12844), 0.22, 0.04, 0, 0, 270.0, 60.0, true, true, false, true, 1, true)
    table.insert(bags,Headbag)
    SendNUIMessage({type = 'bagOn'}) -- Trigger NUI image of the headbag (make player blind)
    SetNuiFocus(false,false) -- idk why but without this the player is stuck in the nui
    hasBag = true
    Citizen.CreateThread(function()
        while true do
            Wait(60*1000*minutes)
            TriggerEvent('wx_headbag:takeOff')
            break
        end
    end)
end)

Thanks

What would i add to just add a command to say /takeofheadbag