Xwad Posted May 22, 2016 Share Posted May 22, 2016 I am trying to attach a custom weapon to a normal weapon but it's not working. function getWeapon() local PedWeapon = getPedWeapon(getLocalPlayer(),30) if ( PedWeapon ) then local weapon = createWeapon("m4", 0,0,0) attachElements ( weapon, PedWeapon, 0, 0, 1, 0, 0, 0 ) end end addCommandHandler("t", getWeapon) no debug Link to comment
Dimos7 Posted May 22, 2016 Share Posted May 22, 2016 Try that function getWeapon() local PedWeapon = getPedWeapon(localPlayer) if (PedWeapon == 30) then loceal weapon = createWeapon("m4", 0, 0, 0) attachElements(weapon, PedWeapon, 0, 0, 1, 0, 0, 0) end end addCommandHandler("t", getWeapon) Link to comment
Xwad Posted May 22, 2016 Author Share Posted May 22, 2016 bad argumentum @ 'attachElements' [Expected element at argumentum 2, got number '30'] Link to comment
Dimos7 Posted May 22, 2016 Share Posted May 22, 2016 function getWeapon() local PedWeapon = getPedWeapon(localPlayer, 5) if PedWeapon == 30 then weapon = createWeapon("m4", 0, 0, 0) attachElements(weapon, PedWeapon, 0, 0, 1, 0, 0, 0) end end addCommandHandler("t", getWeapon) 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