• How to Remove Entities
    2 replies, posted
I want to know how to remove a Jeep after I have spawned it. The code to spawn the jeep is: [lua]function JeepSpawn( ply ) local tr = ply:GetEyeTrace() local car = ents.Create("prop_vehicle_jeep_old") car:SetModel("models/buggy.mdl") car:SetKeyValue("vehiclescript","scripts/vehicles/jeep_test.txt") car:SetPos(tr.HitPos + Vector( 0, 0, 10 ) ) car:Spawn() end[/lua] I found what I thought might be the answer, but im not sure how to use it [url]http://wiki.garrysmod.com/?title=Undo.AddEntity[/url] Although that says "adds to the players undo list", but doesn't actually remove the entity. Bearing in my I have not derived my gamemode from sandbox (don't know if it matters, but thought I should mention it). Any help will be greatly appreciated. Thanks.
[lua]someEnt:Remove()[/lua]
Really is that it? In my case i would just have [lua]car:Remove()[/lua] God I feel stupid :P
Sorry, you need to Log In to post a reply to this thread.