ENT.PreEntityCopy

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NamePreEntityCopy
SyntaxENT:PreEntityCopy( )
DescriptionCalled before the duplicator copies an entity
ReturnsNil
Lua StateNewerServer.png
BBCode[b][url=wiki.garrysmod.com/?title=ENT.PreEntityCopy]ENT.PreEntityCopy [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionStores an entity's wire info. From the base_wire_entity
Used onNewerServer.png
Code
function ENT:PreEntityCopy()
	local dupeInfo = {}
	if self.Vehicle and self.Vehicle:IsValid() and self.Vehicle:IsVehicle() then
		dupeInfo.VehicleID = self.Vehicle:EntIndex()
	end
	duplicator.StoreEntityModifier(self, "VehicleDupeInfo", dupeInfo)
end
OutputStores the vehicle reference of the contraption


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox