Jump to content

How to determine if something attached to player's hand?


thund3rbird23

Recommended Posts

Posted

I attached a crate to the player's hand, is there any way to determine if the crate is attached or not?

 

crate = createObject(2912,0,0,0)
exports.bone_attach:attachElementToBone(crate,localPlayer,12,0,0,0.70,0,165,0) 

 

Posted

I'm trying to figure out how to use this function, but doesn't works.

Attached "doboz" to the player's hand:

doboz[thePlayer] = createObject(2912,0,0,0)
exports.bone_attach:attachElementToBone(doboz[thePlayer], thePlayer, 12,0,0,0.70,0,165,0)

And after that I wants to get if the "doboz" attached to the bone or no:

function xy(thePlayer)
if (exports.bone_attach:isElementAttachedToBone(doboz[thePlayer]))then
outputChatBox("Yes!")
else
outputChatBox("No!")
end
addCommandHandler("xy", xy)
Posted

Is it not working at all or is it saying No in the chat box? if it's the later, make sure that the player who's calling the command "xy" has an element attached and stored in the table doboz. if it's not working at all check the debug.

Posted
1 hour ago, PaiN^ said:

Is it not working at all or is it saying No in the chat box? if it's the later, make sure that the player who's calling the command "xy" has an element attached and stored in the table doboz. if it's not working at all check the debug.

Uff, I just forgot to close the function with 'end'. It's works now.

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