Jump to content

Need help with a Hat script


Recommended Posts

Posted

Hi you all, i just made my first script. It is supposed to attach an element to the player but what i need is to attach element to an specific bone of the playermodel, but i dont know how, i really appreciate if you could help me guys :D

client

function GasMask ( hat ) 
      local x, y, z = getElementPosition ( getLocalPlayer ) 
      local mask = createObject( 2054, x, y, z )  
      attachElements ( mask, getLocalPlayer), 0, 0, 5 ) 
end 
      addCommandHandler ( "hat", GasMask ) 

server

function GasMask ( thePlayer, hat ) 
      local x, y, z = getElementPosition ( thePlayer )  
      local mask = createObject( 2054, x, y, z ) 
      attachElements ( mask, thePlayer, 0, 0, 5 )  
end 
      addCommandHandler ( "hat", GasMask ) 

Posted
There has to be another way, bone attachment is old and there is nothing about it in wiki

You need to download Bone_attch resource as xXMADEXx said then use this

exports.bone_attach:attachElementToBone(object,player,bone,x,y,z,xr,xy,xz) 

Do not yield your back to your enemy, might feel something strange in your ass.

Two things are infinite the universe and human stupidity and i'm not sure about the universe.

UF: IsTextInGridList | GetGridListRowIndexFromText | Table.removeValue | removeHex | dxDrawTriangle

Skype: SaSuki102 | About Me | Youtube channel | Lua Tips & Tricks | Lua Strings | Lua Tables | Lua Operators

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