local ply = FindMetaTable("Player")

local teams = {}

teams[1] = {
     name = "Survivor",
     color = Color(20,20,20),
     weapons = { "" } }
teams[2] = {
     name = "Jason",
     color = Color(10,10,10),
     weapons = { "" } }

function ply:SetupTeam( n )
	if ( not teams[n] ) then return end

     self:SetTeam( n )
     
end

function ply:GiveWeapons( n )
	for k, weapon in pairs( teams[n].weapons ) do
		self:Give( weapon )
	end
end

hook.Add("PlayerSpawn", "RemoveFlashLightForJason", function(ply)
     if ply:Team() == 2 then
       timer.Simple(0.01,function()
         ply:StripWeapon("weapon_flashlight")
       end)
     end
    end)

hook.Add("ScalePlayerDamage", "FlashlightBlockDamage", function(ply, hitgroup, dmginfo)
    if(ply:Team() != dmginfo:GetAttacker():Team()) then
       if dmginfo:GetAttacker():GetActiveWeapon():GetClass() == "weapon_flashlight" then
         dmginfo:ScaleDamage(0)
       end
    end
end)