Garry's Mod Wiki

undo.SetCustomUndoText

  undo.SetCustomUndoText( string customText )

Description

Sets a custom undo text for the current undo block

Arguments

1 string customText
The text to display when the undo block is undone

Example

This example creates a prop_physics, adds it to the players undo list, and sets a custom undo text

local 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.SetCustomUndoText("Undone a crate prop") undo.Finish()