Good afternoon everyone I’m trying to use SET_PED_HEAD_OVERLAY but they are not working could someone help me?
This would be interesting, a time ago I had tried do this, but didn’t find anything on http://docs.fivem.net/ and I decided let this a side
If you don’t show how you use it, we can’t help you
SetPedHeadOverlay(playerPed, 1, 4,1.0) ?
Yes, should works
It is not working, the other sets work, except the one that does not
Do you use it on MP model? Because I don’t think it works on AI ped.
Otherwise, show your script, we need to see how you use it to help.
Ok, maybe because you need to apply a color on your overlay.
This is my function to change head overlay:
function ChangeOverlay(overlayId, value, opacity, color)
Citizen.CreateThread(function()
SetPedHeadOverlay(GetPlayerPed(-1), overlayId, value, opacity)
if(overlayId == 1 or overlayId == 10 or overlayId == 2) then
SetPedHeadOverlayColor(GetPlayerPed(-1), overlayId, 1, color, color)
elseif (overlayId == 5 or overlayId == 8) then
SetPedHeadOverlayColor(GetPlayerPed(-1), overlayId, 2, color, color)
else
SetPedHeadOverlayColor(GetPlayerPed(-1), overlayId, 0, color, color)
end
end)
end
More info: https://runtime.fivem.net/doc/natives/#_0x497BF74A7B9CB952
I’ll try, thanks.
You reverse overlayid and colorType:
SetPedHeadOverlayColor(playerPed, 1, 16, 5, 5)
--to
SetPedHeadOverlayColor(playerPed, 16, 1, 5, 5)
nothing happened
My bad, 16 isn’t overlayId but overlayIndex, should be good:
SetPedHeadOverlayColor(playerPed, 1, 1, 5, 5)
nothing happened, why will not it be working?
I’m not at home, so I can’t test it. Currently, I don’t have any idea why it’s not working. I’ll test it when I could
Thanks, when I can test I’ll be expecting <3, but I’ll try here
Ok I found a solution:
Citizen.CreateThread(function()
while true do
Citizen.Wait(10)
if IsControlPressed(1, 23) then --only test
local playerPed = GetPlayerPed(-1)
SetPedHeadBlendData(playerPed, 0, 0, 0, 0, 0, 0, 0.5, 0.5, 0, true)
while HasPedHeadBlendFinished(playerPed) do
Citizen.Wait(0)
end
--SET_PED_COMPONENT_VARIATION(Ped ped, int componentId, int drawableId, int textureId, int paletteId)
SetPedComponentVariation(playerPed, 0, 0, 0, 2) --face
SetPedComponentVariation(playerPed, 2, 20, 4, 2) --hair
SetPedComponentVariation(playerPed, 4, 1, 5, 2) -- legs
SetPedComponentVariation(playerPed, 6, 1, 0, 2) -- under
SetPedComponentVariation(playerPed, 11, 7, 2, 2) -- jackPreformatted text
SetPedHeadOverlay(playerPed, 1, 16, 0.99)
SetPedHeadOverlayColor(playerPed, 1, 1, 5, 5)
SetPedPropIndex(playerPed, 0, 46, 0, 0)
end
end
end)
It didn’t work because of head blend data, I don’t know why but if someone have the answer
I tested here and nothing has changed ‘-’
Hummm strange, it works for me with the mp model (mp_m_freemode_01). I’ll look again when I’ll be home
Thanks <3
Hi , Good morning