undo.AddEntity

From Garry's Mod
Jump to: navigation, search
 undo.AddEntity( )

Contents

Description

Adds an entity to the current undo block

Arguments

Entity ent

The entity to add

Examples

Example

This example creates a prop_physics, and adds it to the players undo list.

prop = ents.Create("prop_physics")
prop:SetModel("models/props_junk/wood_crate001a.mdl")
prop:Spawn()

undo.Create("prop")
	undo.AddEntity(prop)
	undo.SetPlayer(Player)
undo.Finish()


Personal tools
Navigation