StipWeapons help

function stripweapons(ply)
hook.Add("PlayerSpawn", "StripWeaps", stripweapons)

I have this in my init file but when i start the gamemode it I still have all my weaopns with no errors the in console. What is wrong?

just find your GM:PlayerSpawn function in init.lua and put ply:StripWeapon in it rather than hooking it.

like this:
function GM:PlayerSpawn(ply)
–other stuff here

Ok but why wouldent it work with using a hook because i am not using sandbox as a base

For some reasons your hook must be executed before the ones that give weapons…
The first thing you could try would be overriding the other hooks by returning a value.

Oh and did you know you could use [lua] tags instead of


[lua]function stripweapons(ply)
    return false
hook.Add("PlayerSpawn", "StripWeaps", stripweapons)[/lua]

i just slapped a timer around ply:StripWeapons(), works dandily for me.