(BUMP) I’ve tried experimenting with a different vehicle,
Here is the script that i tried
‘’
local loaded = false
function loadTxd()
local txd = CreateRuntimeTxd(‘duiTxd’)
local duiObj = CreateDui(‘http://i.imgur.com/bvhD7sq.gif’, 640, 360)
_G.duiObj = duiObj
local dui = GetDuiHandle(duiObj)
local tx = CreateRuntimeTextureFromDuiHandle(txd, ‘duiTex’, dui)
AddReplaceTexture(‘origTxd’, ‘orginTxn’, ‘duiTxd’, ‘duiTex’)
end
Citizen.CreateThread(function()
while loaded == false do
Wait(0)
local playerCar = GetVehiclePedIsIn(GetPlayerPed(-1))
if playerCar ~= 0 then
if GetEntityModel(playerCar) == GetHashKey(‘lamboMurcielago’) then
loadTxd()
loaded = true
end
end
if not loaded then
local veh = nil
for veh in EnumerateVehicles() do
if GetEntityModel(playerCar) == GetHashKey(‘lamboMurcielago’) then
loadTxd()
loaded = true
break
end
end
end
end
end)
‘’
Opening it up in OpenIV, I would be looking to replace its livery with a animated file. So I look for its ‘_sign’ file, for me, its sign is ‘f450ambo_sign_1’.
In order for my texture to be replaced, the code would be as follows:
local txd = CreateRuntimeTxd('duiTxd')
local duiObj = CreateDui('https://media3.giphy.com/media/TJb0yO9rhndYF3RJKi/source.gif', 600, 600)
_G.duiObj = duiObj
local dui = GetDuiHandle(duiObj)
local tx = CreateRuntimeTextureFromDuiHandle(txd, 'duiTex', dui)
AddReplaceTexture('f450ambo', 'f450ambo_sign_1', 'duiTxd', 'duiTex')
And with that I have a animated livery on my ambulance. Just make sure you open the .ytd and find the name of the texture you want to replace. You cannot just use the name of the .ytd like your example shows. It must be the actual texture name inside the dictionary.
Ok done, I’ve loaded the same as what you’ve pasted and obvs changed the name etc, and i am trying it on a police mustang, ill let you know if i get it working, Thank you in advance.