Jump to content

Cant apply texture to some id


MavisBey4807

Recommended Posts

I cant apply any texture to this id. I tried other "WORKING" textures from my other scripts. And nothing changes just original textures. Not blank white texture.

here is my client.lua

dff = engineLoadDFF ( "hamam.dff" )
engineReplaceModel ( dff, 17517 )
txd = engineLoadTXD ( "hamam.txd" )
engineImportTXD ( txd, 17517 )
 

here is my meta.xml

<meta>
    <info author='MavisBey' name='MavisBey4807' />
       <script src='client.lua' type='client' />
     <file src="hamam.dff" />
     <file src="hamam.txd" />

</meta>
 

Link to comment
  • Other Languages Moderators

From your code, it looks like the texture (TXD) is being loaded after the model (DFF), which might be why it's not applying correctly. The correct order is to load the texture first, then the model.

Here's a working example:

local MODEL = 17517

addEventHandler("onClientResourceStart", resourceRoot,
    function()
        local texture = engineLoadTXD("example.txd")

        if not texture then
            return
        end

        engineImportTXD(texture, MODEL)

        local model = engineLoadDFF("example.dff")

        if not model then
            return
        end

        engineReplaceModel(model, MODEL)
    end
)

meta.xml:

<meta>
    <script src="client.lua" type="client" />

    <file src="example.txd" />
    <file src="example.dff" />
</meta>
Link to comment
7 hours ago, Nico834 said:

From your code, it looks like the texture (TXD) is being loaded after the model (DFF), which might be why it's not applying correctly. The correct order is to load the texture first, then the model.

Here's a working example:

local MODEL = 17517

addEventHandler("onClientResourceStart", resourceRoot,
    function()
        local texture = engineLoadTXD("example.txd")

        if not texture then
            return
        end

        engineImportTXD(texture, MODEL)

        local model = engineLoadDFF("example.dff")

        if not model then
            return
        end

        engineReplaceModel(model, MODEL)
    end
)

meta.xml:

<meta>
    <script src="client.lua" type="client" />

    <file src="example.txd" />
    <file src="example.dff" />
</meta>

i tried it but still nothing changed.

https://ibb.co/sByvTDD

https://ibb.co/35W0ZSJx

Link to comment
  • Other Languages Moderators

Now that you've shared the contents of your TXD file, it's clear why you're not seeing any difference. The 17517 ID is linked to templae2land.txd, and the chipboard_256128 texture is exactly the same. So even though you're replacing it in the script, you're still applying the same texture.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...