Jump to content
  • 0

How to replace objects? My script is not working!


rusztamas

Question

Hey guys, i want to replace the object "bustopm" (id 1257), i exported all files, from GTA:SA (txd, dff) and i created a file, script.lua, and i created it's meta file, and it is still not working! Script:

function ReplaceObject ( ) 
  
txd = engineLoadTXD( "name.txd" ) 
dff = engineLoadDFF( "name.dff", 0 ) 
  
engineImportTXD( txd, 1257 ) 
engineReplaceModel( dff, 1257 ) 
  
end 
  
addEvent ( "replaceObj", true ) 
addEventHandler ( "replaceObj", root, ReplaceObject ) 

Link to comment

1 answer to this question

Recommended Posts

  • 0
  • MTA Team

Enable debugging output by pressing F8 and entering the command: debugscript 3

Then insert outputDebugString as show below and run the script again,

function ReplaceObject ( ) 
  
txd = engineLoadTXD( "name.txd" ) 
dff = engineLoadDFF( "name.dff", 0 ) 
  
engineImportTXD( txd, 1257 ) 
engineReplaceModel( dff, 1257 ) 
  
outputDebugString( "ReplaceObject " 
                      .. " txd:" .. tostring(txd) 
                      .. " dff:" .. tostring(dff) 
                      ) 
end 
  
addEvent ( "replaceObj", true ) 
addEventHandler ( "replaceObj", root, ReplaceObject ) 

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...