Garry's Mod Wiki

constraint.RemoveAll

  boolean, number constraint.RemoveAll( Entity ent )

Description

Attempts to remove all constraints associated with an entity

Arguments

1 Entity ent
The entity to remove constraints from

Returns

1 boolean
Whether any constraints were removed
2 number
Number of constraints removed

Example

From stools/remover.lua

-- Reload removes all constraints on the targetted entity function TOOL:Reload( trace ) if ( !IsValid( trace.Entity ) or trace.Entity:IsPlayer() ) then return false end return constraint.RemoveAll( trace.Entity ) end