Garry's Mod Wiki


  Entity constraint.Weld( Entity ent1, Entity ent2, number bone1, number bone2, number forcelimit, boolean nocollide, boolean deleteent1onbreak )


Creates a weld constraint


1 Entity ent1
The first entity
2 Entity ent2
The second entity
3 number bone1
The bonenumber of the first entity (0 for monoboned entities)

PhysObj number for ragdolls, see: Entity:TranslateBoneToPhysBone.

4 number bone2
The bonenumber of the second entity
5 number forcelimit
The amount of force appliable to the constraint before it will break (0 is never)
6 boolean nocollide
Should ent1 be nocollided to ent2 via this constraint
7 boolean deleteent1onbreak
If true, when ent2 is removed, ent1 will also be removed


1 Entity


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