Garry's Mod Wiki


game.CleanUpMap( boolean dontSendToClients = false, table ExtraFilters = {} )


If called serverside it will remove ALL entities which were not created by the map(not players or weapons held by players).

On the client it will remove decals, sounds, gibs, dead NPCs, and entities created via ents.CreateClientProp.

This function calls GM:PreCleanupMap before cleaning up the map and GM:PostCleanupMap after cleaning up the map.

Calling this in a ENTITY:StartTouch or ENTITY:Touch hook will crash the game.
Calling this destroys all BASS streams.
This can crash when removing _firesmoke entities.


1 boolean dontSendToClients = false
If set to true, don't run this functions on all clients.
2 table ExtraFilters = {}
Entity classes not to reset during cleanup.

Page Links

Special Pages



Render Time: 34ms

DB GetPage 3
Generate Html 4
SaveChanges 11
Render Body 0
Render Sidebar 13