Jump to content

AttachElements


Xwad

Recommended Posts

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

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
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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...