Kenix Posted May 10, 2011 Share Posted May 10, 2011 i create this script for easy replace txd and dff but filepath not work i test filepath and it work please help me with filepath this work addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() vehicleIDs = { {470} } for i,v in pairs(vehicleIDs) do txd = engineLoadTXD("models/patriot.txd",v[i]);engineImportTXD(txd, v[i]) dff = engineLoadDFF("models/patriot.dff",v[i]);engineReplaceModel(dff, v[i]) end end ) but this not woking.i need fix it addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function() vehicleIDs = { {470} } for i,v in pairs(vehicleIDs) do txd = engineLoadTXD("models/"..v[i]..".txd",v[i]);engineImportTXD(txd, v[i]) dff = engineLoadDFF("models/"..v[i]..".dff",v[i]);engineReplaceModel(dff, v[i]) end end ) Link to comment
Arran Posted May 10, 2011 Share Posted May 10, 2011 v is wrong. It should just be using v[1] and v[2] Your table should be like { {470, "patriot"} } In that case v[1] will be 470 and v[2] will be patriot which is the name of your txd and dff vehicleIDs = { {470, "patriot"} } for i,v in pairs(vehicleIDs) do txd = engineLoadTXD("models/"..v[2]..".txd",v[1]);engineImportTXD(txd, v[1]) dff = engineLoadDFF("models/"..v[2]..".dff",v[1]);engineReplaceModel(dff, v[1]) end Link to comment
Kenix Posted May 10, 2011 Author Share Posted May 10, 2011 v is wrong. It should just be using v[1] and v[2]Your table should be like { {470, "patriot"} } In that case v[1] will be 470 and v[2] will be patriot which is the name of your txd and dff vehicleIDs = { {470, "patriot"} } for i,v in pairs(vehicleIDs) do txd = engineLoadTXD("models/"..v[2]..".txd",v[1]);engineImportTXD(txd, v[1]) dff = engineLoadDFF("models/"..v[2]..".dff",v[1]);engineReplaceModel(dff, v[1]) end ok thx dude Link to comment
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now