Overkillz Posted December 8, 2015 Share Posted December 8, 2015 Hey dear community, today I started to read about attachElements, well, I would like to attach a Spoiler to my infernus, I've already got the .dff file but I couldn't do it. function attachU ( source, commandName ) local x, y, z = getElementPosition ( source ) local aleron1 = engineLoadDFF ( "test.dff", 411 ) local aleron = createElement ( aleron1, x, y, z + 3 ) attachElements ( aleron, source, 0, 0, 5 ) end addCommandHandler ( "aleron", attachU ) DebugScript 3 drops me this message: I hope you can help me, thanks for your time. Regards. Link to comment
myonlake Posted December 8, 2015 Share Posted December 8, 2015 You have to modify your script-tag in meta.xml by enabling the type attribute for client (type="client"). Link to comment
Overkillz Posted December 8, 2015 Author Share Posted December 8, 2015 thanks, I have forgotten that engineLoadDFF is a client side function. anyways im getting this problem: Link to comment
Rockyz Posted December 8, 2015 Share Posted December 8, 2015 (edited) Hey dear community, today I started to read about attachElements, well, I would like to attach a Spoiler to my infernus, I've already got the .dff file but I couldn't do it. function attachU ( source, commandName ) local x, y, z = getElementPosition ( source ) local aleron1 = engineLoadDFF ( "test.dff", 411 ) local aleron = createElement ( aleron1, x, y, z + 3 ) attachElements ( aleron, source, 0, 0, 5 ) end addCommandHandler ( "aleron", attachU ) DebugScript 3 drops me this message: I hope you can help me, thanks for your time. Regards. element createElement ( string elementType, [ string elementID = nil ] ) you need to use createObject if You Want To Attach like this ex : function attachU ( plr, commandName ) local x, y, z = getElementPosition ( plr ) local aleron1 = engineLoadDFF ( "test.dff", 411 ) local aleron = createObject ( 980, x, y, z + 3 ) attachElements ( aleron, plr, 0, 0, 5 ) end addCommandHandler ( "aleron", attachU ) Edited December 8, 2015 by Guest Link to comment
myonlake Posted December 8, 2015 Share Posted December 8, 2015 Your script is never going to work. You need to replace an existing vehicle upgrade or attach an object with a replaced model and texture. It's not as simple as you thought it's going to be. Link to comment
Overkillz Posted December 8, 2015 Author Share Posted December 8, 2015 @#,+( _xiRoc[K]; > - it just add an object above my position. Im trying to attach my own element. @myonlake - I didnt understand both answer, Im trying to implement the model "test.tff" which is a spoiler for a car. Well, are you telling me that i can't implement it ? Sorry, I didnt understand that part. Link to comment
Overkillz Posted December 8, 2015 Author Share Posted December 8, 2015 I could fix my problem, but now Im getting a problem with the gamera, when I turn the spoiler on, it moves my camera so close between my camera and vehicle. Link to comment
ALw7sH Posted December 8, 2015 Share Posted December 8, 2015 Your script is never going to work.You need to replace an existing vehicle upgrade or attach an object with a replaced model and texture. It's not as simple as you thought it's going to be. Actully it's simple, adding the spoiler to the car dff file then hiding/showing it using setVehicleComponentVisible With this method you'll even be able to change the spoiler color ingame Link to comment
Overkillz Posted December 8, 2015 Author Share Posted December 8, 2015 Thanks man, and regarding about remove the default upgrades from infernus, could u tell me what is the function ? 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