detachElements
Shared
Detaches an element from the element it hangs on. It stays where it is.
bool detachElements(element element [, element target = nil])
Parameters
| Name | Type | Description |
|---|---|---|
| element | element | The element to detach. |
| target | element | If given, the element is only detached when it hangs on this target.default nil |
Returns
true if it was detached. false if the element was not attached, if target was given and is not its current target, or if onElementDetach was cancelled.
Example
addCommandHandler("soltar", function(player)
local target = getElementAttachedTo(player)
if target then
detachElements(player, target)
end
end)