Garry's Mod Wiki

duplicator.RegisterConstraint

  duplicator.RegisterConstraint( string name, function callback, any ... )

Description

Register a function used for creating a duplicated constraint.

Arguments

1 string name
The unique name of new constraint
2 function callback
Function to be called when this constraint is created
3 any ...
Arguments passed to the callback function

Example

This is from lua/includes/modules/constraint.lua, it registers the Weld Constraint.

duplicator.RegisterConstraint( "Weld", Weld, "Ent1", "Ent2", "Bone1", "Bone2", "forcelimit", "nocollide", "deleteonbreak" )