Remove weapons

I don’t like how my users always spawn with rockets and crossbows etc

How could I make it so they only spawn with physgun, grav, crowbar, pistol, toolgun, and smg?

Add a hook that on spawn player:StripWeapon()s them. Let me know if you need an example.

Or just override the PlayerLoadout hook.

not sure if this works but
–Give weapons here
return true

An example would be awesome. I’m guessing I’m going to have to write a lua?
Where would I put it?

Actually, GRB’s method was much more efficient and sensible, as his spawns only a set weapons. Mine spawns the weapons then remove them, wasting time/valuble memory.

Having proofread his code, it seems fine, here’s how to implement it, without using an addon.

  1. Find/create the directory garrysmod/garrysmod/lua/autorun/server
  2. Create the file SetLoadout.lua
  3. Copy as paste the code as above, adding in ply:Give(“weaponname”) for each weapon you want them to have.

That should overwrite the normal hooks and give them that loadout.

Enjoy :slight_smile: Thanks for the better method GRB.

Awesome! Thanks!, could you tell me like the “technical” name for the tool gun though? Is it like weapon_toolgun