Disable weapon pickup, problem.

hey guys,
My script will not run, and i dont know why, I do get an error though:


 sandbox_v1/gamemode/init.lua:196: unexpected symbol near '=='  

I have tried making one = sign, instead of 2, tried geting rid of the [v]… Any suggustions?



------------------------------------------------------------------------
WeaponTable = {

"weapon_shotgun", 
"weapon_ar2",
"weapon_smg1",
"weapon_frag",
"weapon_crossbow",
"weapon_357",
"weapon_crowbar",
"weapon_pistol",
}

function PlayerCanPickupWeapon(ply, wep)

	if ply:Team() == 1 then
		wep:GetClass()==(WeaponTable[v]) then 
		return false 
	end
	
	return true

end

hook.Add("PlayerCanPickupWeapon", "RandomUniqueName", PlayerCanPickupWeapon)
--------------------------------------------------------------------------------


Thanks!

That isn’t even Lua.
[lua]
WeaponTable = {
“weapon_shotgun”,
“weapon_ar2”,
“weapon_smg1”,
“weapon_frag”,
“weapon_crossbow”,
“weapon_357”,
“weapon_crowbar”,
“weapon_pistol”
}

function PlayerCanPickupWeapon( ply, wep )
if ply:Team() == 1 ang table.HasValue( WeaponTable, wep:GetClass() ) then
return false
end
return true
end
hook.Add( “PlayerCanPickupWeapon”, “Team1_PlayerCanPickupWeapon”, PlayerCanPickupWeapon )
[/lua]

Okay, yeah… you’re right, this wa sjust a script put together by like 3 sources, so…
But yeah, i need a script that will make it so team 1 can’t pick up weapons. Any idea;s?

The script TehBigA gave you, should do what you want. This version spares some lines:

[lua]WeaponTable = {
“weapon_shotgun”,
“weapon_ar2”,
“weapon_smg1”,
“weapon_frag”,
“weapon_crossbow”,
“weapon_357”,
“weapon_crowbar”,
“weapon_pistol”
}

hook.Add( “PlayerCanPickupWeapon”, “Team1_PlayerCanPickupWeapon”, function( ply, wep )
return !( ply:Team( ) == 1 and table.HasValue( WeaponTable, wep:GetClass( ) ) )
end )[/lua]

Didnt TehBigA make a spelling mistake?

[lua]
WeaponTable = {
“weapon_shotgun”,
“weapon_ar2”,
“weapon_smg1”,
“weapon_frag”,
“weapon_crossbow”,
“weapon_357”,
“weapon_crowbar”,
“weapon_pistol”
}

function PlayerCanPickupWeapon( ply, wep )
if ply:Team() == 1 ang table.HasValue( WeaponTable, wep:GetClass() ) then
return false
end
return true
end
hook.Add( “PlayerCanPickupWeapon”, “Team1_PlayerCanPickupWeapon”, PlayerCanPickupWeapon )
[/lua]

Shouldnt the word ang be and?