Garry's Mod Wiki

Garry's Mod Wiki

  boolean undo.ReplaceEntity( Entity from, Entity to )

Description

Replaces any instance of the "from" reference with the "to" reference, in any existing undo block.

You very likely want to call cleanup.ReplaceEntity with the same entities as well.

Arguments

1 Entity from
The old entity
2 Entity to
The new entity to replace the old one. Can also be a NULL to remove the entity from the undo system.

Returns

1 boolean
Whether the entity was replaced

Example

When an entity is ragdolled, this will replace any instances of the entity with it's ragdoll.

function GM:CreateEntityRagdoll( entity, ragdoll ) // Replace the entity with the ragdoll in cleanups etc undo.ReplaceEntity( entity, ragdoll ) cleanup.ReplaceEntity( entity, ragdoll ) end

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...