Garry's Mod Wiki


  table, table duplicator.Paste( Player Player, table EntityList, table ConstraintList )


"Given entity list and constraint list, create all entities and return their tables"

Calls duplicator.CreateEntityFromTable on each sub-table of EntityList. If an entity is actually created, it calls ENTITY:OnDuplicated with the entity's duplicator data, then duplicator.ApplyEntityModifiers, duplicator.ApplyBoneModifiers and finally ENTITY:PostEntityPaste is called.

The constraints are then created with duplicator.CreateConstraintFromTable.


1 Player Player
The player who wants to create something
2 table EntityList
A table of duplicator data to create the entities from
3 table ConstraintList
A table of duplicator data to create the constraints from


1 table
List of created entities
2 table
List of created constraints


Code used for a TOOL to copy duplication data on right click and paste it with its original info on left click.

function TOOL:LeftClick( trace ) if (SERVER) then duplicator.Paste(self:GetOwner(),Dupe.Entities,Dupe.Constraints) print("PASTED") end return true end function TOOL:RightClick( trace ) if (SERVER and IsValid(trace.Entity)) then Dupe = duplicator.Copy(trace.Entity) print("COPIED") end return true end