Gamemode.EntityRemoved

From GMod Wiki

Jump to: navigation, search
Event Hook
Hook NameEntityRemoved
SyntaxGM:EntityRemoved( Entity )
DescriptionCalled right before an entity is removed. (Note that this isn't going to be totally reliable on the client since the client only knows about entities that it has had in its PVS.)
ReturnsNil
Lua StateNewerShared.png
BBCode[b][url=wiki.garrysmod.com/?title=Gamemode.EntityRemoved]Gamemode.EntityRemoved [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Example

DescriptionPrint "removed <entity model>!" to the server console, when you remove an entity
Used onNewerServer.png
Code
 
function entityRemoved(ent)
   Msg("removed " .. ent:GetModel() .. "!")
end
 
hook.Add("EntityRemoved", "entRemoved", entityRemoved)
 
Outputremoved <entity model>!


Additional Notes

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox