duplicator.Paste
Description
"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.
Arguments
Returns
Example
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