So I have a script that gives me health when I do /heal I want the same thing but when I do /armor it gives me armor. I figured that I could just send in the script that does /heal and someone could re write to give me armor, I tried it myself but spent like an hour of trying and could not do it.
RegisterNetEvent("ARPF:heal")
AddEventHandler("ARPF:heal", function()
local prop = "prop_ld_health_pack"
playerPed = GetPlayerPed(-1)
local pedPos = GetEntityCoords(playerPed, false)
exports['progressBars']:startUI(7000, "Healing") -- Progress Bar can be changed if you dont have it
RequestAnimDict("[email protected]_a")
while not HasAnimDictLoaded("[email protected]_a") do
Citizen.Wait(100)
end
TaskPlayAnim(GetPlayerPed(PlayerId()), "[email protected]_a", "idle_a", 1.0, -1, -1, 50, 0, 0, 0, 0)
local bone = GetPedBoneIndex(GetPlayerPed(-1), 18905) -- 18905 28422
local heals = CreateObject(GetHashKey(prop), 1.0, 1.0, 1.0, 1, 1, 0)
shieldEntitys = heals
--AttachEntityToEntity(shieldEntitys, playerPed, bone, 0.18, 0.0, 0.0, 135.0, -100.0, 0.0, 1, 0, 0, 0, 2, 1)
AttachEntityToEntity(shieldEntitys, playerPed, bone, 0.15, 0.05, -0.01, 180.0, 220.0, 20.0, 1, 1, 0, 0, 2, 1)
-- ["xR"] = 315.0,["yR"] = 288.0, ["zR"] = 0.0
Citizen.Wait(7000)
DeleteEntity(shieldEntitys)
health = GetEntityHealth(playerPed)
chelth = health + 30
SetEntityHealth(playerPed, chelth)
StopAnimTask(PlayerPedId(), '[email protected]_a', 'idle_a', 1.0)