duplicator.GetAllConstrainedEntitiesAndConstraints

From GMod Wiki

Jump to: navigation, search
Function
Syntax duplicator.GetAllConstrainedEntitiesAndConstraints( Entity )
Where is this used?
Description:
Returns all entities constrained to the entity and all of their constraints.
Returns: Table Entities, Table Constraints
Part of Library: duplicator
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Duplicator.GetAllConstrainedEntitiesAndConstraints]Duplicator.GetAllConstrainedEntitiesAndConstraints [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionThis example removes all the welds from a contraption.
Used onNewerServer.png
Code
 
function RemoveContraptionsWelds(entity)
 
  local entities, constraints = duplicator.GetAllConstrainedEntitiesAndConstraints(entity)
 
   for k,v in pairs(constraints)do
 
      if( v.Type == "Weld" )then
           v:Remove()
      end
 
   end
 
end
 
OutputNone
Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox