undo.Create
Example
This example creates a prop_physics, and adds it to Player's undo list.
Example
When you need to override the undo messages for a spawnable entity inside ENT:SpawnFunction(user, trace)
and apply a custom text, calling undo.Create()
will not work and will in fact double the undo entries in the list pointing to the same entity created. Otherwise you will see Scripted Entity (entity_class)
when you create it. This is defined in commands.lua and you must return nil
, then add the remaining hooks and function calls to account for the missing stuff: