Garry's Mod Wiki

Entity:Remove

  Entity:Remove()

Description

Removes (or deletes) a given Entity.

The Entity will continue to exist until the start of the next tick.

To check if an Entity will be removed in the next tick, see Entity:IsMarkedForDeletion

Example

Removes the Entity being looked at by the first Player to join the server.

local firstPlayer = player.GetAll()[1] local targetEntity = firstPlayer:GetEyeTrace().Entity if IsValid( targetEntity ) then targetEntity:Remove() end