cleanup.ReplaceEntity

From GMod Wiki

Revision as of 13:46, 13 September 2009 by UnrealomegaBot (Talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Function
Syntax cleanup.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: cleanup
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Cleanup.ReplaceEntity]Cleanup.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


Additional Notes

See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox