Vazern Posted April 1, 2018 Share Posted April 1, 2018 Hello! I need to use attachElements with an object in a player's gun, but from what I noticed the player's weapon is not recognized as "element". Code: function customM4(source) if getPedWeapon(source) == 31 then local gunModel = createObject(1487, 1, 2, 3) attachElements(gunModel, getPedWeapon(source)) end end addCommandHandler("m4skin", customM4) Link to comment
myonlake Posted April 1, 2018 Share Posted April 1, 2018 (edited) There's a couple ways you can do that as far as I know: a) Attach the object to the player element and try to figure out the rotation in a render loop. b) Create a custom weapon, which you need to also manually attach for the player element. The way you are trying to do it right now is not possible since a ped weapon is not an element. Edited April 1, 2018 by myonlake 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