Weapon For Specific Player

How could I make it so only one specific player with a specified SteamID could spawn with a weapon. In this case, the weapon is “admin_stick”.

SWEP.AdminOnly = true

I don’t want admins spawning it. Just me.

Put this:


if self.Owner:SteamID() != "urstemid" then self:Remove() end

into your SWEP:Deploy or SWEP:Think

Would it be possible to automatically make me spawn with it every time? If not, I’ll just use that and spawn it manually, I guess.


hook.Add("PlayerSpawn","why",function( p ) if ( p:SteamID() == "ursteemId" ) then p:Give("wepon-clas") end end)

Sorry, but where would I add this?

Anywhere when it gets called by server. In your SWEP, outside of any functions, in a “if SERVER then /code/ end” will do.

Thanks! It worked.