cratzy42O Posted January 27, 2016 Share Posted January 27, 2016 So as first idk if is a right place to post here about my problem here you go The codes ... .lua scrip Resource in folder file lua code function ReplaceCar() txd = engineLoadTXD('buffalo.txd', 402) engineImportTXD(txd, 402) dff = engineLoadDFF('buffalo.dff', 402) engineReplaceModel(dff, 402) end addEventHandler( 'onClientResourceStart', getResourceRootElement(getThisResource()), ReplaceCar) Error ? here attemp to call global "getThisResource" (a nil value) Link to comment
1LoL1 Posted January 27, 2016 Share Posted January 27, 2016 addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () txd = engineLoadTXD("buffalo.txd", 402) engineImportTXD(txd, 402) dff = engineLoadDFF("buffalo.dff", 402) engineReplaceModel(dff, 402) end) Link to comment
cratzy42O Posted January 27, 2016 Author Share Posted January 27, 2016 still the same error can you show me a easy way to replace car models ? Link to comment
1LoL1 Posted January 27, 2016 Share Posted January 27, 2016 still the same error can you show me a easy way to replace car models ? Do you have added in meta.xml? "buffalo.dff" /> "buffalo.txd" /> Link to comment
cratzy42O Posted January 27, 2016 Author Share Posted January 27, 2016 yup i got this in meta <meta> <info author="CraTzy" description="fasat BMW model" version="1.3" type="script" /> <script src="client.lua" type="client"/> <file src="buffalo.dff" type="client"/> <file src="buffalo.txd" type="client"/> </meta> ERROR STILL POP UP Link to comment
1LoL1 Posted January 27, 2016 Share Posted January 27, 2016 yup i got this in meta <meta> <info author="CraTzy" description="fasat BMW model" version="1.3" type="script" /> <script src="client.lua" type="client"/> <file src="buffalo.dff" type="client"/> <file src="buffalo.txd" type="client"/> </meta> ERROR STILL POP UP "CraTzy" description="fasat BMW model" version="1.3" type="script" /> Link to comment
cratzy42O Posted January 27, 2016 Author Share Posted January 27, 2016 still. maybe cuz i use Luaedit ? Link to comment
//_Dragon Posted January 27, 2016 Share Posted January 27, 2016 function replaceskin() --- i change it to replaceskin for vehicle txd = engineLoadTXD ( "buffalo.txd" ) ---file.txd engineImportTXD ( txd, 402) dff = engineLoadDFF ( "buffalo.dff", 402) -- file.dff engineReplaceModel ( dff, 402) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceskin) ---- here when the mod started the skin will be automatic changed Link to comment
cratzy42O Posted January 27, 2016 Author Share Posted January 27, 2016 (edited) function replaceskin() --- i change it to replaceskin for vehicle txd = engineLoadTXD ( "buffalo.txd" ) ---file.txd engineImportTXD ( txd, 402) dff = engineLoadDFF ( "buffalo.dff", 402) -- file.dff engineReplaceModel ( dff, 402) end addEventHandler ( "onClientResourceStart", getResourceRootElement(getThisResource()), replaceskin) ---- here when the mod started the skin will be automatic changed bro i am sorry always same error i just copy/paste whole code and .. Shiet.. same error ii am bored of it whole day trying to fix it EDIT: getThisResource makes error in lua Edited January 27, 2016 by Guest Link to comment
1LoL1 Posted January 27, 2016 Share Posted January 27, 2016 Tested and worked. meta.xml "TEST" description="TEST" version="TEST" type="script" /> client-side: addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () txd = engineLoadTXD("infernus.txd") engineImportTXD(txd, 402) dff = engineLoadDFF("infernus.dff", 402) engineReplaceModel(dff, 402) end) Link to comment
//_Dragon Posted January 27, 2016 Share Posted January 27, 2016 Actually this work too.meta.xml "TEST" description="TEST" version="TEST" type="script" /> client-side: addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () txd = engineLoadTXD("infernus.txd") engineImportTXD(txd, 402) dff = engineLoadDFF("infernus.dff", 402) engineReplaceModel(dff, 402) end) you forget add function replaceskin() Link to comment
cratzy42O Posted January 27, 2016 Author Share Posted January 27, 2016 Tested and worked.meta.xml "TEST" description="TEST" version="TEST" type="script" /> client-side: addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () txd = engineLoadTXD("infernus.txd") engineImportTXD(txd, 402) dff = engineLoadDFF("infernus.dff", 402) engineReplaceModel(dff, 402) end) luaedit Gives me always same error Link to comment
1LoL1 Posted January 27, 2016 Share Posted January 27, 2016 Tested and worked.meta.xml "TEST" description="TEST" version="TEST" type="script" /> client-side: addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () txd = engineLoadTXD("infernus.txd") engineImportTXD(txd, 402) dff = engineLoadDFF("infernus.dff", 402) engineReplaceModel(dff, 402) end) luaedit Gives me always same error So you're doing something wrong. For me it is functioning normally. Use this: 1 - use /refreshall 2 - restart script and tell me if work. Link to comment
1LoL1 Posted January 27, 2016 Share Posted January 27, 2016 Actually this work too.meta.xml "TEST" description="TEST" version="TEST" type="script" /> client-side: addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () txd = engineLoadTXD("infernus.txd") engineImportTXD(txd, 402) dff = engineLoadDFF("infernus.dff", 402) engineReplaceModel(dff, 402) end) you forget add function replaceskin() no? if i use this i don't must use function name. Link to comment
cratzy42O Posted January 27, 2016 Author Share Posted January 27, 2016 Tested and worked.meta.xml "TEST" description="TEST" version="TEST" type="script" /> client-side: addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), function () txd = engineLoadTXD("infernus.txd") engineImportTXD(txd, 402) dff = engineLoadDFF("infernus.dff", 402) engineReplaceModel(dff, 402) end) luaedit Gives me always same error So you're doing something wrong. For me it is functioning normally. Use this: 1 - use /refreshall 2 - restart script and tell me if work. ill go try ingame this i am scares the Folder of Server is frozen to yesterday date because the logo files dont output in current time it output yesterday date 12pm EDIT: yes ingame works all fine i just ignored the "Error" anyway thanks for nice help 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