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
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.
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.
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)