Garry's Mod Wiki

undo.Do_Undo

  number undo.Do_Undo( table tab )

Description

Processes an undo block (in table form). This is used internally by the undo manager when a player presses Z.

You should use gm_undo or gm_undonum *num* console commands instead of calling this function directly.

Arguments

1 table tab
The undo block to process as an Undo structure

Returns

1 number
Number of removed entities

Example

This example removes two entities, and informs player 1 that they just "Undone Prop!"

local tab = {} tab.Owner = Entity(1) tab.Name = "prop" tab.Entities = {Entity(56),Entity(57)} undo.Do_Undo(tab)