yesyesok Posted March 16, 2015 Posted March 16, 2015 I wanted to attach a vehicle to an invisible object, What functions should i use. It would be great if it's posted with a example. I'm beginner lua scripter.
Miika Posted March 16, 2015 Posted March 16, 2015 You need to use the AttachElements function. Syntax: bool attachElements ( element theElement, element theAttachToElement, [ float xPosOffset, float yPosOffset, float zPosOffset, float xRotOffset, float yRotOffset, float zRotOffset ] ) Example: function attachObjects() -- Let's make a function local marker = createMarker ( 0, 0, 10, "cylinder", 1.5, 255, 255, 0, 170 ) -- Creating the marker local car = createVehicle(551, 0, 0, 10) -- Creating the vehicle attachElements(marker, car) -- Now we have a marker that's attached into vehicle- end -- Close the function
yesyesok Posted March 17, 2015 Author Posted March 17, 2015 ik about attaching object but i'm asking how should i attach vehicle to objects?
xXMADEXx Posted March 17, 2015 Posted March 17, 2015 ik about attaching object but i'm asking how should i attach vehicle to objects? I'm not 100% sure if you can, because I've never tried it. If you can, it should just use the example that Miika gave with the marker and vehicle switched.
yesyesok Posted March 17, 2015 Author Posted March 17, 2015 hey, I tried Alot but still i'm not able to attach vehicle to objects, I'm trying to make moving vehicle, So i decided to attach the vehicle to moving object and change the alpha of the objects, Objects are getting created but vehicles are not getting attached to it.
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