Install it properly.
lua/autorun/server/removemics.lua
hook.Add("Think", "gtfomicrophones", function()local foundfor _, ply in pairs(player.GetAll()) doif ply:Team() == "TEAM_RADIOOP" thenfound = trueendendif found then return endfor k, v in pairs(ents.GetAll()) doif v:GetClass() == "microphone" thenv:Remove()endendend)
That's both wrong AND the most inefficient way to do it.
ply:Team() always returns an integer. Comparing it to a string will always return false.
Try this:
hook.Add("OnPlayerChangedTeam", "RemoveMicrophones", function(ply, oldteam, newteam)
for k, v in pairs(player.GetAll()) do
if v:Team() == TEAM_RADIOOP then -- Assuming the team is TEAM_RADIOOP
return
end
end
for k,v in pairs(ents.FindByClass("microphone")) do
SafeRemoveEntity(v)
end
end)
Edited:
Now stop bumping a dead thread.
One of my favourite servers is running this mod. It still works, it's still good and therefore the thread for it is not dead.