undo.ReplaceEntity

From GMod Wiki

Revision as of 00:14, 22 October 2009 by Crazy Quebecer (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax undo.ReplaceEntity( Entity from, Entity to )
Where is this used?
Description:
Replaces any instance of the "from" reference with the "to" reference. Returns true if something was replaced.
Returns: Boolean
Part of Library: Undo
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Undo.ReplaceEntity]Undo.ReplaceEntity [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionWhen an entity is ragdolled, this will replace any instances of the entity with it's ragdoll.
Used onNewerServer.png
Code
function GM:CreateEntityRagdoll( entity, ragdoll )
 
	// Replace the entity with the ragdoll in cleanups etc
	undo.ReplaceEntity( entity, ragdoll )
	cleanup.ReplaceEntity( entity, ragdoll )
 
end
OutputNone


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox