[FREE] Optimized & SYNCED Animated Vehicles

Still Working on this? :slight_smile: lol
meantime… here is the destroy dui fix

local _duiObj = nil
local duiObjs = {}

function loadTxd(model, liveryDict, gif) 
    local txd = CreateRuntimeTxd('duiTxd')
    _duiObj = CreateDui(gif, 680, 680)
    _G._duiObj = _duiObj
    local dui = GetDuiHandle(_duiObj)
    local tx = CreateRuntimeTextureFromDuiHandle(txd, 'duiTex', dui)
    AddReplaceTexture(model, liveryDict, 'duiTxd', 'duiTex')
    table.insert(duiObjs, _duiObj)
end

AddEventHandler('onResourceStop', function(resource)
    if resource == GetCurrentResourceName() then
        for _,duiObj in pairs(duiObjs) do
			if IsDuiAvailable(duiObj) then
				--print("Destroying...", duiObj)
				DestroyDui(duiObj)
			end
        end
    end
end)

just quickly hammered it in there lol

1 Like

Hey! I kinda need help! <3
i love ur script, i wanna use it, i took some of the texture names from Openiv, and they dont work,

Example:
I have a Car called “flatbed4” and i wanna animate the texture cxxtow_sign_2,cxxtow_sign_3,cxxtow_sign_4,cxxtow_sign_5

and i write it like this in the cl_animated.lua (i tried with ending .ytd and stuff idk)
what am i doing wrong? its not working at all!
[“flatbed4”] = { active = false, dict = ‘cxttow_sign_2’, gif = ‘xponentialdesign GIF - Find & Share on GIPHY’, name = ‘flatbed4.ytd’ },

[“flatbed4”] = { active = false, dict = ‘cxttow_sign_3’, gif = ‘xponentialdesign GIF - Find & Share on GIPHY’, name = ‘stream/flatbed4.ytd’ },

[“flatbed4”] = { active = false, dict = ‘cxttow_sign_4’, gif = ‘xponentialdesign GIF - Find & Share on GIPHY’, name = ‘flatbed4’ },

Was looking for some assistance on this as well, I have a mustang19 and I set it up pretty much the same as above, however it shows up only my license plate animated, but not on the entire car. I have however saw that changing the livery with my mech script swapped over to it being on the car, however it was a static livery and not an animated gif. Are we supposed to be the name for what would be the sign or livery for the car where it says dict=“”, and then I assume whatever .ytd file is in the stream folder for the car. Please correct me if i’m wrong. I was lookin for a discord to join possibly for support but couldnt find one