Restrict weapon script not working.

Hello, I am really new to scripting, and the first thing I am trying to do is to make a restriction script to a weapon for my server. Unfortunately the script is not working/bugging(In my opinion). Could someone please help me to understand/fix what I am doing wrong?

Script: [lua]hook.Add(“WeaponEquip”, “GoldenDeagle”, function(weapon)
local ply = weapon:GetOwner()
if !weapon:GetClass() == weapon_goldendeagle then return end
ply:PrintMessage(3, "Picked Up: "…weapon:GetClass()) – Debug to know what is not working. Don’t seem to work, since it say Pick Up to all weapons.
ply:StripWeapon(“weapon_goldendeagle”)
end)[/lua]

I also tried this: [lua]local function goldendeagle(weapon)
local ply = weapon:GetOwner()
if !weapon:GetClass() == weapon_goldendeagle then return end
ply:StripWeapon(“weapon_goldendeagle”)
end[/lua]

and this one: [lua]hook.Add(“WeaponEquip”, “Grabbin.Peelz”, function(weapon)

-- put everything inside this timer so it's called on the next frame.
timer.Simple(0, function()
	local ply = weapon:GetOwner() -- no longer a null entity.
    if !weapon:GetClass() == weapon_goldendeagle then return end
	ply:PrintMessage(3, "Picked Up: "..weapon:GetClass()) -- inform the player.
    ply:StripWeapon("weapon_goldendeagle")
end) 	

end)[/lua]

The last one is a mix between a Pick up message and what I want it to do.

Change it to “weapon_goldendeagle”

You’re acting as if weapon_goldendeagle is a variable, but you obviously aren’t creating it, so you’re doing “if !weapon:GetClass() == nil then”
Also, “if !weapon:GetClass() == nil then” is pretty much “if false == nil then”

if weapon:GetClass() != “weapon_goldendeagle” then

Yeah. 10 min later I saw that stupid mistake and fixed it. Thanks anyways.