local elements = {
['player'] = true,
['ped'] = true,
['vehicle'] = true,
['object'] = true,
}
addEventHandler ( "onElementClicked" , root , function (theButton,theState,element)
if ( theButton == "left" and theState == "down" and elements[getElementType(source)] ) then
if ( isElementAttached ( source ) == false ) then
attachElements ( source, element , 0,3,0 )
else
detachElements ( source , element )
end
end
end )