--	local hit, position = workspace:FindPartOnRayWithIgnoreList(ray, ignoreList)

	local hit, position = workspace:FindPartOnRay(ray, parts.Parent);
	
	if hit then -- Leaderboard Supported
		if hit.Parent:IsA("Model") then
			local player = game.Players:GetPlayerFromCharacter(hit.Parent);
			local DriverKOs = script.Parent.Parent.Parent.leaderstats:findFirstChild("KOs")
			local humanoid = hit.Parent:findFirstChild("Humanoid");
			print("XD")
			if player and humanoid then
				if player.TeamColor ~= parts.Parent.Tank.Value then --Not a teammate
					if humanoid.Health >0 then
						humanoid:takeDamage(MGDamage);
						if humanoid.Health <=0 then
							DriverKOs.Value = DriverKOs.Value + 1
						end
					end
				end
			end
		
	

				
		end
	end
	
	local distance = (position - machineGun.Position).magnitude;
	
	local rayPart	= rayPart:clone();
	rayPart.Size	= Vector3.new(.2, distance, .2);
	rayPart.CFrame	= CFrame.new(position, machineGun.Position)
						* CFrame.new(0, 0, -distance/2)
						* CFrame.Angles(math.rad(90),0,0);
	rayPart.Parent	= workspace;
	game.Debris:AddItem(rayPart, .03)
	game.Debris:AddItem(PL, .03)
	
	local MGFlash =	parts.Parent.Gun.Coax.GUI:clone()
	MGFlash.Flash.Rotation = math.random(0,360)
	MGFlash.Parent = parts.Parent.Gun.Coax
   	MGFlash.Enabled = true
	game.Debris:AddItem(MGFlash,.01)
	
	wait();

	wait();
	
	return true;
end
