Jump to content

bad arg @ destroyElement


pa3ck

Recommended Posts

You should then try with helmet[thePlayer] instead of helmet[lp] :)

EDIT: Try this:

helmet = {} 
--lp = getElementType(thePlayer) 
if getElementData(thePlayer, 'helmetOn') ~= 1 then 
    setElementData(thePlayer, 'helmetOn', 1) 
    local x, y, z = getElementPosition(thePlayer) 
    helmet[thePlayer] = createObject(2053, x, y, z) 
    setObjectScale(helmet[thePlayer], 2.4) 
    exports.bone_attach:attachElementToBone(helmet[thePlayer],thePlayer,1,0,0.03,0.1,0,0,180) 
else 
    setElementData(thePlayer, 'helmetOn', 0) 
    destroyElement(helmet[thePlayer]) 
    helmet[thePlayer] = nil 
end 

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