StipWeapons help

function stripweapons(ply)
    ply:StripWeapons()
end
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:
[lua]
function GM:PlayerSpawn(ply)
–other stuff here
ply:StripWeapons()
end
[/lua]

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

 ones? 

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

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