undo.AddEntity

From GMod Wiki

Jump to: navigation, search
Function
Syntax undo.AddEntity( Entity entity )
Where is this used?
Description:
This adds an entity to the players undo list
Returns: nil
Part of Library: Undo
Realm: NewerServer.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Undo.AddEntity]Undo.AddEntity [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]



Examples

DescriptionThis example creates a prop_physics, and adds it to the players undo list.
Used onNewerServer.png
Code
 
function addProp(Player)
    prop = ents.Create("Prop_Physics")
    undo.Create("prop")
        undo.AddEntity(prop)
        undo.SetPlayer(Player)
    undo.Finish()
end
 
addProp(player.GetById(1))
OutputN/A


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox