[HELP] How to get Bulletproof Vests as an Item?

Hey , I wanted to know how to get Bulletproof Vests as an item so I can put them in the Store and Stuff.
Would appreciate if someone could help. Thank you.

1 Like

first add the item to the database, give it the name you want.

example: tuitem

then in “client.lua” puts this:

RegisterNetEvent('cosasvariadas:tuitem')
AddEventHandler('cosasvariadas:tuitem', function()

local playerPed = PlayerPedId()

AddArmourToPed(playerPed, 100)
SetPedArmour(playerPed, 100)

end)

then in “server.lua” puts this:

ESX.RegisterUsableItem('tuitem,', function(source)

	local xPlayer = ESX.GetPlayerFromId(source)

	xPlayer.removeInventoryItem('tuitem', 1)

    TriggerClientEvent('cosasvariadas:tuitem', source)
    

end)

remember that “tuitem” is changed to the item name you created.

1 Like

thank you <3

hmm I did that and it says “Kevlar is not usable”

could you show me how you put the codes and item name in the database?

1 Like

Screenshot_5

Screenshot_2 Screenshot_4

I even tried using the TUITEM name you gave it still didn’t work. It didn’t even get any errors

1 Like

Did you start the resource in you server.cfg.

And from the screenshots the resource isnt in your resources folder?

in the “client.lua” tries to have the code like this:

https://gyazo.com/315a94dd0602a63c679597084f9ef856

on the “server.lua” tries to have the code like this:

https://gyazo.com/714e5fcc0ac332e26d0b2970e7afde0e

and in the “_resource.lua” like this:

https://gyazo.com/adb63beed50245a9e536c49830baa40b

I’m literally passing you a script to create your vest, to the folder (CosasVariadas) put the name you want and don’t forget to start it in the “server.cfg”

psdt: the code can be put inside another script, but it’s not recommended, so you have your things tidy

1 Like

Thank you. Gonna try it out <3

Ty , do you have anything against it if I release it?

1 Like

Because no one has release something like that and Its actually very usefull.

the code this, people just don’t know how to look good.

you can do it no problem, total the code I wrote by hand.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.