Eagler Posted September 25, 2016 Share Posted September 25, 2016 Client gate = createObject( 3055, 2335.1005859375, 2443.7001953125, 7 ) setElementRotation ( gate, 0, 0, 59.996337890625 ) gatecol = createColCircle ( 15, 15, 15 ) function openagates(thePlayer) if getElementModel( thePlayer ) == 217 then moveObject ( gate, 3055, 2335.1005859375, 2443.7001953125, 12 ) end end addEventHandler( "onColShapeHit", gatecol, openagates ) function closeagates(thePlayer) if getElementModel( thePlayer ) == 217 then moveObject (gate1, 5000, 2335.1005859375, 2443.7001953125, 7) end end addEventHandler( "onColShapeLeave", gatecol, closeagates ) Meta <meta> <info type="script" name="LVPD" author="." version="1.0.0" /> <script src="client.lua" type="server" /> </meta> Car problem function replaceModel() txd = engineLoadTXD('car.txd',596) engineImportTXD(txd,596) dff = engineLoadDFF('car.dff',596) engineReplaceModel(dff,596) end addEventHandler ( 'onClientResourceStart', getResourceRootElement(getThisResource()), replaceModel) addCommandHandler ( 'reloadcar', replaceModel ) <meta> <info author="." description="LSP" version="1.3" type="script" /> <script src="client.lua" type="server"/> <file src="car.txd" type="client"/> <file src="car.dff" type="client"/> </meta> Link to comment
Eagler Posted September 25, 2016 Author Share Posted September 25, 2016 Lol gates now opening but not closed Link to comment
MTA Team ccw Posted September 25, 2016 MTA Team Share Posted September 25, 2016 For the correct syntax on engineLoadTXD and engineLoadDFF, see Example 1 here: https://wiki.multitheftauto.com/wiki/EngineLoadTXD Also, use the command debugscript 3 to see client script errors Link to comment
Gravestone Posted September 26, 2016 Share Posted September 26, 2016 14 hours ago, Eagler said: Lol gates now opening but not closed That's because 14 hours ago, Eagler said: moveObject (gate1, 5000, 2335.1005859375, 2443.7001953125, 7) It's gate, not gate1. Link to comment
koragg Posted September 27, 2016 Share Posted September 27, 2016 Here's my car replace script, just replace the car ID and file names. client.lua function CarModel() txd = engineLoadTXD ( "BMW.txd" ) engineImportTXD ( txd, 451 ) dff = engineLoadDFF ( "BMW.dff", 451 ) engineReplaceModel ( dff, 451 ) end addEventHandler('onClientResourceStart', resourceRoot, CarModel) addCommandHandler ( 'reloadcar', CarModel ) function Timer() setTimer(CarModel, 500, 1) end addEventHandler('onClientResourceStart', resourceRoot, Timer) meta.xml <meta> <file src="BMW.txd" /> <file src="BMW.dff" /> <script src="BMW.lua" type="client" /> </meta> 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