Hi! I want to put this gloves or something similar to my character before starting a fight, like first 4 seconds of this video:
Someone know if I have to stream the arms, or if it’s something already developed or native to put it?
Thanks!
Hi! I want to put this gloves or something similar to my character before starting a fight, like first 4 seconds of this video:
Someone know if I have to stream the arms, or if it’s something already developed or native to put it?
Thanks!
I answer myself:
local Gloves = {}
function putGloves()
local ped = GetPlayerPed(-1)
local hash = GetHashKey('prop_boxing_glove_01')
while not HasModelLoaded(hash) do RequestModel(hash); Citizen.Wait(0); end
local pos = GetEntityCoords(ped)
local gloveA = CreateObject(hash, pos.x,pos.y,pos.z + 0.50, true,false,false)
local gloveB = CreateObject(hash, pos.x,pos.y,pos.z + 0.50, true,false,false)
table.insert(Gloves,gloveA)
table.insert(Gloves,gloveB)
SetModelAsNoLongerNeeded(hash)
FreezeEntityPosition(gloveA,false)
SetEntityCollision(gloveA,false,true)
ActivatePhysics(gloveA)
FreezeEntityPosition(gloveB,false)
SetEntityCollision(gloveB,false,true)
ActivatePhysics(gloveB)
if not ped then ped = GetPlayerPed(-1); end -- gloveA = L, gloveB = R
AttachEntityToEntity(gloveA, ped, GetPedBoneIndex(ped, 0xEE4F), 0.05, 0.00, 0.04, 00.0, 90.0, -90.0, true, true, false, true, 1, true) -- object is attached to right hand
AttachEntityToEntity(gloveB, ped, GetPedBoneIndex(ped, 0xAB22), 0.05, 0.00, -0.04, 00.0, 90.0, 90.0, true, true, false, true, 1, true) -- object is attached to right hand
end
function removeGloves()
for k,v in pairs(Gloves) do DeleteObject(v); end
end
where to take gloves?