GetElementAttachedTo
Jump to navigation
Jump to search
This function returns an element from the specified ID.
Syntax
element getElementAttachedTo ( element theElement )
Required Arguments
- theElement: The element you require the information for.
Returns
Returns the element that the chosen element is attached to, or false if the element isn't attached to another element.
Example
This example assigns the element that the specified element is attached to into attached.
addEventHandler ( "onConsole", root, "onConsole" ) function onConsole ( text ) if ( getElementType ( source ) == "player" ) then command = gettok ( text, 1, 32 ) if ( command == "getattached" ) then attached = getElementAttachedTo ( source ) if ( attached ) then outputConsole ( "element type: " .. getElementType ( attached ) ) -- possible output else outputConsole ( "not attached to an element" ) -- display error end end end end
See Also
- attachElements
- createElement
- destroyElement
- detachElements
- getAttachedElements
- getElementAlpha
- getElementAttachedOffsets
- getElementAttachedTo
- getElementByIndex
- getElementByID
- getElementChild
- getElementChildren
- getElementChildrenCount
- getElementCollisionsEnabled
- getElementColShape
- getElementData
- getAllElementData
- hasElementData
- getElementDimension
- getElementHealth
- getElementID
- getElementInterior
- getElementMatrix
- getElementModel
- getElementParent
- getElementPosition
- getElementRotation
- getElementsByType
- getElementsWithinColShape
- getElementsWithinRange
- getElementType
- getElementVelocity
- getLowLODElement
- getRootElement
- isElement
- isElementAttached
- isElementCallPropagationEnabled
- isElementDoubleSided
- isElementFrozen
- isElementInWater
- isElementLowLOD
- isElementWithinColShape
- isElementWithinMarker
- setElementAlpha
- setElementAngularVelocity
- getElementAngularVelocity
- setElementAttachedOffsets
- setElementCallPropagationEnabled
- setElementCollisionsEnabled
- setElementData
- setElementDimension
- setElementDoubleSided
- setElementFrozen
- setElementHealth
- setElementID
- setElementInterior
- setElementModel
- setElementParent
- setElementPosition
- setElementRotation
- setElementVelocity
- setLowLODElement
- getPedContactElement
- getResourceDynamicElementRoot
- getResourceRootElement