Guides‎ > ‎


This is not necessarily for any question, but for rare stuff not covered anywhere else. Most of it relates to modding, some of it to rare problems.

Rearm scripts show errors on my Linux server. How do I fix this?

This is caused by Lua/GMod's unintelligent handling of line endings. The rearm script files need to have Windows-style line ending markers for Windows servers, but on Linux they need to be Linux-style. Most decent text editors have an option for "EOL conversion" or similar.
If you have shell access on the linux box, you could navigate to where the scripts are and run:
dos2unix *.txt
That will convert all the scripts in one go. Converted scripts with proper line endings will no longer error.

How do I make my custom ammo entities spawn as random ammo?

ENT.AutoSpawnable = true
Note that this works on any entity, not just ammo. So if you want to randomly spread a certain entity across the map, this might be a workable method.

How do I allow spectators to possess my custom entity?

ENT.AllowPropspec = true

How do I keep players from picking up my custom entity?

ENT.CanPickup = false