Disable the Ball entity on a dedicated server?

I don’t know if there is a console command or a lua script I need, but people spam balls on my server and place them in small areas that cause huge lag. So does anyone know how to disable the ball entity entirely or just limit the amount of entities. And maybe I could delete the files for it so it can’t be accessed online?

Thank you, I just figured out how to make a dedicated server and this has been my only problem so far. :smile:

Get an admin mod such as ASSMod and use that to make the balls admin/owner only.

I have ULX, can I do it with that admin mod? If so please tell me how, some of the commands are so simplified to make them shorter I can’t tell exactly what they do.

[lua]
hook.Add(“PlayerSpawnSENT”, “RestrictBalls”, function(ply, name)

if(name == "sent_ball") then
    ply:SendLua([[GAMEMODE:AddNotify("Restricted", NOTIFY_ERROR, 5);]]);

return false;
end

end)
[/lua]

Put it in autorun/server/

Thank you, I will test this on tomorrow when I get home. If there is some kind of thanking system on this website I will gladly “Thank” you.

Why are you using SendLua?

Just goto lua/entities, and delete sent_ball

That’s what I was thinking, just to delete it from the server. That seems like the simplest thing to do.

Thanks!

[lua]
if(SERVER) then
AddCSLuaFile(“BallRemover.lua”);
return;
end

hook.Add(“InitPostEntity”,“RemoveDatBall”,function()
scripted_ents.GetStored(“sent_ball”) = nil;
hook.Remove(“InitPostEntity”,“RemoveDatBall”);
end);
[/lua]This will also remove the spawnicon from the client etc.