constraint.Weld
Entity constraint.Weld( Entity ent1, Entity ent2, number bone1, number bone2, number forcelimit, boolean nocollide, boolean deleteent1onbreak )
Description
Creates a weld constraint
Arguments
3 number bone1
The bonenumber of the first entity (0 for monoboned entities)
PhysObj number for ragdolls, see: Entity:TranslateBoneToPhysBone.
5 number forcelimit
The amount of force appliable to the constraint before it will break (0 is never)
Returns
Example
Adapted from stools/thruster.lua
function TOOL:LeftClick( trace )
/* Boilerplate stool code to extract ClientConVars to variables */
local thruster = MakeThruster( ply, model, Ang, trace.HitPos, key, key_bk, force, toggle, effect, damageable, soundname )
local weld = constraint.Weld( thruster, trace.Entity, 0, trace.PhysicsBone, 0, collision == 0, true )
-- If you remove the entity thrusters are welded to, the thruster is removed as well
end