Server AntiChoke

Whenever a minge wants to crash a server all he has to do is click his mouse on the spawn menu causing props to stack up inside each other choking the server with collisions.

This script I have here helps prevent that by making spawned props that intersect another nocollide until they come apart and then they go back to normal.

Features:
-Prevents Server Crashing by spamming props inside each other
-Doesn’t lag at all no matter how many props are registered as spam. (Does 1 OOB check/trace per tick)

This won’t protect against spam, but it will protect against 50 bridges spawned inside of one another choking the server to death.

If I could get all servers using this script I would be really grateful because I am sick of entering a server and finding 80 boats fused together or 60 bridges in each other or a little pissy kid gets dmed one time and responds with 80 bridges. This script will fix all that.
It seems like something like this would have already been made, and I’m sorry if it has, but this is the only good working one I have ever seen in action.

This is a simple lua script, extract to garrysmod/garrysmod or simply drag the .lua file to lua/autorun

-ADDED VEHICLE SPAWNING PROTECTION
-PROPS NO LONGER NOCOLLIDE WITH EVERYTHING
-PROPS WITH TOO MANY COLLISIONS CAUGHT NOW CLOAK SO YOU KNOW IF YOU HAVE A PROP THAT IS NOCOLLIDED AND YOU CAN FIX THE PROP WITH RIGHT CLICK WITH NOCOLLIDE TOOL.
http://www.garrysmod.org/img/?t=dll&id=100151

-Bugs
*Like all props that nocollide with another prop I’ve found it impossible to return them to their original state. This shouldn’t be a problem.

If this becomes popular enough, I’m hoping garry will make this script mandatory for sandbox. If you happen to read this garry, go ahead if you want. This script is yours.

Here is an image showing 51 fps with 215 unfrozen chairs on my locally hosted server O_O. 215 UNFROZEN! THIS IS MADNESS! There are 120 nocollides since the first 15 chairs default to nocolliding, but after 15 they nocollide with everything to prevent too many nocollides and a server crash. As you can see my fps which normally is around 200 is down to 51 because of all the frikken chairs, but you can also see that there are no physical actions. Also if somebody were to take a prop and swat at that stack of chairs, they will only hit the 15 that aren’t totally nocollided.

http://img62.imageshack.us/img62/3439/gmflatgrass0038.jpg

Have a wrench good sir :smiley:

I’ll download if it stops vehicles from doing this, most PPs only protect against props, but even 5 chairs inside each other cause a ton of lag when there are huge contraptions being built.

Just give me a moment, I’ll add this feature :slight_smile:

Nice, useful.

Vehicles won’t choke servers now. The buggy kinda misbehaves but it doesn’t lag very much.

Thanks, have a wrench :slight_smile:

Awesome, have a tool, i’d give you five if i could.

A new age of building is upon us :buddy:

have a box full off tools!

Ohh this is awesome.

[editline]07:58PM[/editline]

No more wooden chair crashing

Thank you! :love:

So youve changed like 3 lines of code in antispam to make it nocollide instead of be useless till interacted with?

This is pure fucking win.

One thing, if someone for example spawns a wall, with duplicator he duplicaties it, then spawn another one, and the duplicated walls edge hits the other walls edge(a little bit inside the other), will this be like, not working? Because lots of people do this, and this wont be that good if so.

Sorry for my bad English-

I’m not sure what wall you’re talking about. Try it and if it doesn’t work tell me and i’ll refine it so that it does.

This isn’t antispam. This stops server from processing collisions of props that can potentially cause a lot of lag by being spawned inside of each other.

Excellent! This really should help people who run servers. Honestly, I have been in many good servers who succumb to this fatal glitch. This should be a script included with gmod by default.

Clever. I was hoping for something like this for a while. Nice work. /second it coming with Sandbox.

This is a great script, im asing myself why i dint think of this to fix it Good job!

However theres a bad part in it.
If some one spawns a prop inside another one, and refuses to move em, then ever mistake of spawning a prop inside an other thing is fucked up, since it does 1 check, and ignores the fact that there are other players waiting until there porps getting fixed :frowning: