Entity remove on map start?

Hi. How can i remove entity with lua after map is loaded up?
I wanna remove the stupid zombie spawner button from sb_new_worlds_2.

Here is my current lua script but this wont work :frowning:


if (SERVER) then
    local map = game.GetMap()
    if string.find(map,"sb_new_worlds_2") then
        local ents = ents.FindInSphere( Vector(4716, 6270, 4882), 1000 )
        for _,ent in ipairs(ents) do  
            if string.find(ent:GetClass(),"func_button") then  
                ent:Remove()  
            end  
        end  
    end
end


You want to do that in an InitPostEntity Hook.

Its work now :slight_smile: thanks you wery much!

No problem,